projects
/
platform
/
upstream
/
libHarfBuzzSharp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
946d446
)
[serialize] Only pack main object if there are other objects
author
Behdad Esfahbod
<behdad@behdad.org>
Sun, 31 Mar 2019 02:05:51 +0000
(19:05 -0700)
committer
Behdad Esfahbod
<behdad@behdad.org>
Sun, 31 Mar 2019 02:05:51 +0000
(19:05 -0700)
Avoids a memmove for tables that don't use the object packing mechanism.
src/hb-serialize.hh
patch
|
blob
|
history
diff --git
a/src/hb-serialize.hh
b/src/hb-serialize.hh
index
7f32067
..
6179288
100644
(file)
--- a/
src/hb-serialize.hh
+++ b/
src/hb-serialize.hh
@@
-122,8
+122,11
@@
struct hb_serialize_context_t
/* TODO Propagate errors. */
assert (current.length == 1);
- /* TODO Enable when callers are updated. */
- //pop_pack ();
+
+ /* Only "pack" if there exist other objects... Otherwise, don't bother.
+ * Saves a copy. */
+ if (packed.length > 1)
+ pop_pack ();
}
template <typename Type>