Skip to content

Commit

Permalink
spatialdb/spatial_db.cc: use !empty() instead of 'size() > 0'
Browse files Browse the repository at this point in the history
Use empty() since it should be prefered as it has, following
the standard, a constant time complexity regardless of the
containter type. The same is not guaranteed for size().

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
  • Loading branch information
dalgaaf committed Sep 30, 2014
1 parent 0de452e commit 43c789c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion utilities/spatialdb/spatial_db.cc
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ class SpatialIndexCursor : public Cursor {
}
delete spatial_iterator;

valid_ = valid_ && primary_key_ids_.size() > 0;
valid_ = valid_ && !primary_key_ids_.empty();

if (valid_) {
primary_keys_iterator_ = primary_key_ids_.begin();
Expand Down

0 comments on commit 43c789c

Please sign in to comment.