<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-15">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<meta content="text/html; charset=UTF-8">
<style type="text/css" style="">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div dir="ltr">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Helvetica,sans-serif">
<p>I guess this is a matter of taste again. :-)</p>
<p><br>
</p>
<p>I always try to handle all edge cases first, mostly by returning self or something other, so I can keep the main logic clean without any nestings. Not sure whether this is a pattern, but I believe this often helps to improve readability :)</p>
<p>In this example, nil is an edge case, so I would rather tend to handle it first, instead of introducing an extra temporary variable for handling the most common "expected" scenario.</p>
<p><br>
</p>
<p>Best,</p>
<p>Christoph</p>
<div id="x_Signature">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:rgb(0,0,0); font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<div name="x_divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0">
<div><font size="2" color="#808080"></font></div>
</div>
</div>
</div>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>Von:</b> Squeak-dev <squeak-dev-bounces@lists.squeakfoundation.org> im Auftrag von Levente Uzonyi <leves@caesar.elte.hu><br>
<b>Gesendet:</b> Sonntag, 23. Februar 2020 23:46:57<br>
<b>An:</b> The general-purpose Squeak developers list<br>
<b>Betreff:</b> Re: [squeak-dev] The Inbox: Tools-ct.944.mcz</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">My bad, I didn't notice there was no - at the beginning of 2 lines in the
<br>
diff, so ignore what I wrote.<br>
But, the rather unusual ifNil: didn't help noticing that either. I really <br>
think #ifNotNil: should be used there instead:<br>
<br>
         ^(...) ifNotNil: [ ... ]<br>
<br>
<br>
Levente<br>
<br>
On Sun, 23 Feb 2020, Thiede, Christoph wrote:<br>
<br>
> <br>
> The intended difference is that #browseVersionsOf: opens a VB on all versions of aCompiledMethod, whereas #browseMethod: selects aCompiledMethod by default. This is what #selectMethod: does.<br>
> <br>
> <br>
> Do you think the initial selection does not matter?<br>
> <br>
> <br>
> Best,<br>
> <br>
> Christoph<br>
> <br>
> _________________________________________________________________________________________________________________________________________________________________________________________________________________________________<br>
> Von: Squeak-dev <squeak-dev-bounces@lists.squeakfoundation.org> im Auftrag von Levente Uzonyi <leves@caesar.elte.hu><br>
> Gesendet: Sonntag, 23. Februar 2020 19:40:47<br>
> An: squeak-dev@lists.squeakfoundation.org<br>
> Betreff: Re: [squeak-dev] The Inbox: Tools-ct.944.mcz  <br>
> How about not adding #browseVersionsOf:, but chaging the<br>
> body of #browseMethod: to what #browseVersionsOf: is below?<br>
> <br>
> ^x ifNil: [ ^nil ] is the same as ^x but longer, isn't it?<br>
> <br>
> <br>
> Levente<br>
> <br>
> On Sun, 23 Feb 2020, commits@source.squeak.org wrote:<br>
> <br>
> > Christoph Thiede uploaded a new version of Tools to project The Inbox:<br>
> > <a href="http://source.squeak.org/inbox/Tools-ct.944.mcz">http://source.squeak.org/inbox/Tools-ct.944.mcz</a><br>
> ><br>
> > ==================== Summary ====================<br>
> ><br>
> > Name: Tools-ct.944<br>
> > Author: ct<br>
> > Time: 23 February 2020, 5:50:43.489831 pm<br>
> > UUID: 0c54eef3-3e82-1340-9426-3e94151157d6<br>
> > Ancestors: Tools-mt.940<br>
> ><br>
> > Fixes a bug/unnecessary limitation in VersionsBrowser class >> #browseMethod: that raised an error when browsing a method that had been removed from the system.<br>
> ><br>
> > You can also reproduce it via: thisContext method browse "on a fresh image".<br>
> ><br>
> > =============== Diff against Tools-mt.940 ===============<br>
> ><br>
> > Item was changed:<br>
> >  ----- Method: VersionsBrowser class>>browseMethod: (in category 'instance creation') -----<br>
> >  browseMethod: aCompiledMethod<br>
> ><br>
> > +      ^ (self browseVersionsOf: aCompiledMethod)<br>
> > +              ifNil: [^ nil];<br>
> > -      ^ (self browseVersionsForClass: aCompiledMethod methodClass selector: aCompiledMethod selector)<br>
> >                selectMethod: aCompiledMethod;<br>
> >                yourself!<br>
> ><br>
> > Item was added:<br>
> > + ----- Method: VersionsBrowser class>>browseVersionsOf: (in category 'instance creation') -----<br>
> > + browseVersionsOf: aCompiledMethod<br>
> > +<br>
> > +      | methodClass methodSelector |<br>
> > +      methodClass := aCompiledMethod methodClass.<br>
> > +      methodSelector := aCompiledMethod selector.<br>
> > +      ^ self<br>
> > +              browseVersionsOf: aCompiledMethod<br>
> > +              class: methodClass<br>
> > +              meta: methodClass isMeta<br>
> > +              category: (methodClass organization categoryOfElement: methodSelector)<br>
> > +              selector: methodSelector!<br>
> <br>
> <br>
></div>
</span></font>
</body>
</html>