diff options
author | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2015-07-07 19:37:22 +0300 |
---|---|---|
committer | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2015-07-29 11:03:47 +0300 |
commit | 58b93553c10b77eedd573104b56d63916c635cbb (patch) | |
tree | 368648b8ec4af1c82f5dde5f66747975fd04d86c /src/mbgl/geometry | |
parent | 807d87f0f5883e1c697433eca381c860a74596f2 (diff) | |
download | qtlocation-mapboxgl-58b93553c10b77eedd573104b56d63916c635cbb.tar.gz |
Replace size() with empty() whenever possible
Before C++11, std::list's implementation of size was O(n). It should be
all O(1) now, but it is probably still a good idea to use empty() to
emphasize the intend.
Diffstat (limited to 'src/mbgl/geometry')
-rw-r--r-- | src/mbgl/geometry/glyph_atlas.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mbgl/geometry/glyph_atlas.cpp b/src/mbgl/geometry/glyph_atlas.cpp index c2fc23bf9c..43ea585531 100644 --- a/src/mbgl/geometry/glyph_atlas.cpp +++ b/src/mbgl/geometry/glyph_atlas.cpp @@ -61,7 +61,7 @@ Rect<uint16_t> GlyphAtlas::addGlyph(uintptr_t tileUID, } // The glyph bitmap has zero width. - if (!glyph.bitmap.size()) { + if (glyph.bitmap.empty()) { return Rect<uint16_t>{ 0, 0, 0, 0 }; } @@ -114,7 +114,7 @@ void GlyphAtlas::removeGlyphs(uintptr_t tileUID) { GlyphValue& value = it->second; value.ids.erase(tileUID); - if (!value.ids.size()) { + if (value.ids.empty()) { const Rect<uint16_t>& rect = value.rect; // Clear out the bitmap. |