Marcel Taeumel uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-mt.643.mcz ==================== Summary ==================== Name: Tools-mt.643 Author: mt Time: 21 October 2015, 9:32:57.533 am UUID: bab4a899-da58-a849-893a-e974390d7253 Ancestors: Tools-cmm.642 If there is nothing to pretty-diff, show at least the pretty-printed version of the code to avoid confusion. =============== Diff against Tools-cmm.642 =============== Item was changed: ----- Method: ChangeList>>diffedVersionContents (in category 'viewing access') ----- diffedVersionContents "Answer diffed version contents, maybe pretty maybe not" | change class earlier later | (listIndex = 0 or: [changeList size < listIndex]) ifTrue: [^ '']. change := changeList at: listIndex. later := change text. class := change methodClass. (listIndex == changeList size or: [class == nil]) + ifTrue: [^ (self showingPrettyDiffs and: [class notNil]) + ifTrue: [class prettyPrinterClass format: later in: class notifying: nil] + ifFalse: [later]]. - ifTrue: [^ later]. earlier := (changeList at: listIndex + 1) text. ^ TextDiffBuilder buildDisplayPatchFrom: earlier to: later inClass: class prettyDiffs: self showingPrettyDiffs! |
Does this not render the code below the ifTrue:ifFalse: unreachable?
It looks like a unconditional return, which should be factored out to the outer level (which would allow the Compiler would be able to tell you..).. On Wed, Oct 21, 2015 at 2:33 AM, <[hidden email]> wrote: > Marcel Taeumel uploaded a new version of Tools to project The Trunk: > http://source.squeak.org/trunk/Tools-mt.643.mcz > > ==================== Summary ==================== > > Name: Tools-mt.643 > Author: mt > Time: 21 October 2015, 9:32:57.533 am > UUID: bab4a899-da58-a849-893a-e974390d7253 > Ancestors: Tools-cmm.642 > > If there is nothing to pretty-diff, show at least the pretty-printed version of the code to avoid confusion. > > =============== Diff against Tools-cmm.642 =============== > > Item was changed: > ----- Method: ChangeList>>diffedVersionContents (in category 'viewing access') ----- > diffedVersionContents > "Answer diffed version contents, maybe pretty maybe not" > > | change class earlier later | > (listIndex = 0 > or: [changeList size < listIndex]) > ifTrue: [^ '']. > change := changeList at: listIndex. > later := change text. > class := change methodClass. > (listIndex == changeList size or: [class == nil]) > + ifTrue: [^ (self showingPrettyDiffs and: [class notNil]) > + ifTrue: [class prettyPrinterClass format: later in: class notifying: nil] > + ifFalse: [later]]. > - ifTrue: [^ later]. > > earlier := (changeList at: listIndex + 1) text. > > ^ TextDiffBuilder buildDisplayPatchFrom: earlier to: later inClass: class prettyDiffs: self showingPrettyDiffs! > > |
No? The indentation might be confusing. I just expanded the "^ later" return expression. :)
Best, Marcel |
Okay, I just looked at it in the code browser, you're right.. :)
On Wed, Oct 21, 2015 at 9:41 AM, marcel.taeumel <[hidden email]> wrote: > No? The indentation might be confusing. I just expanded the "^ later" return > expression. :) > > Best, > Marcel > > > > -- > View this message in context: http://forum.world.st/The-Trunk-Tools-mt-643-mcz-tp4856974p4857107.html > Sent from the Squeak - Dev mailing list archive at Nabble.com. > |
Free forum by Nabble | Edit this page |