mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-09-18 00:21:27 +00:00
This prevents a buildup of large arrays with a lot of values and then choose one row and throw away the rest. This is great for speed and a must for lazy loading. Previous there was a optimization for this but it was only effective for short combined key path like 'a.b'. This pull request makes it effective for any kind of length of a combined key path like 'a.b.c.d...'. This is done by returning the object at a row in the first found CPArray in the key path that is divided in a first and second part. The first part is never a combined key path. The second part can be a combined key path. If this optimization is not done we will create an array with the valueForKeyPath value on each row and then pick the wanted value for the row and throw away all the other rows. It is much more effective to first pick the row and then do the valueForKeyPath on the rest of the key path.
Requires objj be installed, as well as ojunit, located at http://github.com/cappuccino/ojunit
Run individual tests using a command similar to the following:
objj ojunit/OJTestRunnerText.j cappuccino/Tests/Foundation/CPDateTest.j