rupprecht opened a new pull request, #48607:
URL: https://github.com/apache/arrow/pull/48607

   ### Rationale for this change
   
   When a `std::multimap` has multiple entries with the same key, calling 
`m.find(key)` returns an unspecified element.
   
   Historically, this returns the first matching element. However, this is not 
guaranteed, and recent libc++ changes make this return an arbitrary element. 
This can lead to surprising behavior, i.e. different values returned based on 
what other entries are in the multimap (and what the shape of the internal tree 
is).
   
   ### What changes are included in this PR?
   
   Replace `m.find(key)` with `m.equal_range(key)` to preserve behavior and 
have predictable results. The behavior of this is guaranteed to return a range 
of all matching elements in insertion order, and the beginning of the range is 
the same element as what's normally returned by `m.find(key)`.
   
   ### Are these changes tested?
   
   Yes
   
   ### Are there any user-facing changes?
   
   No


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to