From d5349f9cd31f60914dcacb3a8f540a1eb47c5790 Mon Sep 17 00:00:00 2001 From: Young Hahn Date: Thu, 29 May 2014 05:19:15 -0400 Subject: [PATCH] Don't call varint() more than once. --- src/text/glyph_store.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/text/glyph_store.cpp b/src/text/glyph_store.cpp index 88642907a..3e6c2bc74 100644 --- a/src/text/glyph_store.cpp +++ b/src/text/glyph_store.cpp @@ -93,11 +93,9 @@ void GlyphPBF::parse(FontStack &stack) { pbf glyph_pbf = fontstack_pbf.message(); SDFGlyph glyph; - uint32_t id = 0; while (glyph_pbf.next()) { if (glyph_pbf.tag == 1) { // id - id = glyph_pbf.varint(); glyph.id = glyph_pbf.varint(); } else if (glyph_pbf.tag == 2) { // bitmap glyph.bitmap = glyph_pbf.string(); @@ -116,7 +114,7 @@ void GlyphPBF::parse(FontStack &stack) { } } - stack.insert(id, glyph); + stack.insert(glyph.id, glyph); } else { fontstack_pbf.skip(); }