CFArrayBSearchValues callback functions reversed in lion
| Originator: | loghound | ||
| Number: | rdar://9809774 | Date Originated: | 7/20/2011 |
| Status: | open | Resolved: | |
| Product: | Mac OSX | Product Version: | 10.7 "Lion" |
| Classification: | Reproducible: |
Summary: The callback function of the CFArrayBSearchValues has the arguments reversed from Snow Leopard -- See the the attached project but in summary from my example Snow leopard is passing them back this way ** Edit ** Actually in Lion the values passed can change order from callback to callback 2011-07-20 13:00:22.646 cfbinarysearch[1886:a0f] val1 class: NSCFString, val2 class NSCFDictionary while Lion passes them back reversed 7/20/11 1:06:45.737 PM cfbinarysearch: val1 class: __NSCFDictionary, val2 class __NSCFConstantString This is 100% reproducible (see attached sample project) Steps to Reproduce: Make CFArrayBinarySearch and run it in both and observe said reversal Expected Results: I expect consistent behaviour -- the docs actually aren't clear on the values passed but they should, I think, be the same (it's not obvious why they should change!?!) Actual Results: They are reversed Regression: See attached -- run it in both SL and Lion to enjoy the differences Notes:
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!
I'm not sure why you think this is a bug. A comparator takes two objects and compares them. It can't require the callers to pass the arguments in a certain order. Which one is bigger and which one is smaller can not be influenced by order. If A > B is true, then B < A must be true.