Repository navigation
Pharo io a8 at ohne block - #30
Merged
Merged
Conversation
… is not there variableAt:, segmentAndMethodForResource:andOperation: and segmentsForResourceType: signal KeyNotFound, and the key they name is the variable name, the pair of segment and operation, and the class. The tests say so before the three methods are changed to read their dictionaries without a block. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Dictionary>>#at: is ^ self at: key ifAbsent: [ ... ] and allocates a closure and its context on each call, 232 bytes, also when the key is there. cheapAt: reads the array of associations the way Dictionary>>#at:ifAbsent: does and reports a missing key the way at: does. Collection answers cheapAt: with at:, so that it is right wherever at: stands today. MethodDictionary and WeakValueDictionary keep their values apart from the associations and override at:ifAbsent:; they get the same fallback of their own, so the cheap reading does not reach them. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
variableAt:, segmentAndMethodForResource:andOperation: and segmentsForResourceType: read a dictionary whose key must be there. A missing key is a mistake in the route or the uri space and stays loud: the three keep signalling KeyNotFound with the same key. They no longer allocate the block of Dictionary>>#at: on each call: 105 003 calls and 232 to 264 bytes each while a list of 3 000 rows builds its links. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.