diff options
author | Wouter van Oortmerssen <wvo@google.com> | 2015-05-20 16:19:50 -0700 |
---|---|---|
committer | Wouter van Oortmerssen <wvo@google.com> | 2015-05-20 16:21:22 -0700 |
commit | 7ba29dbe412a25568c8797416c00de47bdac892e (patch) | |
tree | 2768de200d4bc6255346380e978e7fc4957844df /include | |
parent | 3b070310f03326597666babf6654aa983d063bb2 (diff) | |
download | flatbuffers-7ba29dbe412a25568c8797416c00de47bdac892e.tar.gz flatbuffers-7ba29dbe412a25568c8797416c00de47bdac892e.tar.bz2 flatbuffers-7ba29dbe412a25568c8797416c00de47bdac892e.zip |
Small readability improvements to recent commits.
Change-Id: I290c33c475f7b019ab0d3c571245d27351d22fa1
Tested: on Linux.
Diffstat (limited to 'include')
-rw-r--r-- | include/flatbuffers/flatbuffers.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/include/flatbuffers/flatbuffers.h b/include/flatbuffers/flatbuffers.h index 6f120f6b..9502464a 100644 --- a/include/flatbuffers/flatbuffers.h +++ b/include/flatbuffers/flatbuffers.h @@ -287,8 +287,8 @@ public: iterator begin() { return iterator(Data(), 0); } const_iterator begin() const { return const_iterator(Data(), 0); } - iterator end() { return iterator(Data(), EndianScalar(length_)); } - const_iterator end() const { return const_iterator(Data(), EndianScalar(length_)); } + iterator end() { return iterator(Data(), size()); } + const_iterator end() const { return const_iterator(Data(), size()); } // Change elements if you have a non-const pointer to this object. void Mutate(uoffset_t i, T val) { @@ -306,8 +306,7 @@ public: } template<typename K> return_type LookupByKey(K key) const { - std::size_t count = size(); - void *search_result = std::bsearch(&key, Data(), count, + void *search_result = std::bsearch(&key, Data(), size(), IndirectHelper<T>::element_stride, KeyCompare<K>); if (!search_result) { |