-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
option to check duplicate object keys #801
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -518,19 +518,43 @@ namespace detail { | |
unchecked_object:: | ||
~unchecked_object() | ||
{ | ||
if(! data_) | ||
return; | ||
if(sp_.is_not_shared_and_deallocate_is_trivial()) | ||
return; | ||
value* p = data_; | ||
while(size_--) | ||
|
||
for( value* p = data_; p != end_; p += 2 ) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why did you change this loop? I prefer the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see why, because the loop is simpler. |
||
{ | ||
p[0].~value(); | ||
p[1].~value(); | ||
p += 2; | ||
} | ||
} | ||
|
||
unchecked_object:: | ||
unchecked_object( | ||
value* data, | ||
std::size_t size, | ||
storage_ptr const& sp, | ||
bool ignore_duplicates) noexcept | ||
: data_(data) | ||
, end_(data + 2 * size) | ||
, sp_(sp) | ||
, ignore_duplicates_(ignore_duplicates) | ||
{ | ||
} | ||
|
||
std::size_t | ||
unchecked_object:: | ||
size() const noexcept | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did we move this from a header that wasn't visible to a header that is visible? |
||
{ | ||
return std::size_t(end_ - data_) / 2; | ||
} | ||
|
||
void | ||
unchecked_object:: | ||
pop_front() noexcept | ||
{ | ||
data_ += 2; | ||
} | ||
|
||
} // detail | ||
|
||
BOOST_JSON_NS_END | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the
inline
goes on the definition not the declaration (my fault)