<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Refactor BuildbotQueue.compareIterations and BuildbotQueue.compareIterationsByRevisions to be more generic"
   href="https://bugs.webkit.org/show_bug.cgi?id=147667#c4">Comment # 4</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Refactor BuildbotQueue.compareIterations and BuildbotQueue.compareIterationsByRevisions to be more generic"
   href="https://bugs.webkit.org/show_bug.cgi?id=147667">bug 147667</a>
              from <span class="vcard"><a class="email" href="mailto:jmarcell&#64;apple.com" title="Jason Marcell &lt;jmarcell&#64;apple.com&gt;"> <span class="fn">Jason Marcell</span></a>
</span></b>
        <pre>(In reply to <a href="show_bug.cgi?id=147667#c2">comment #2</a>)
<span class="quote">&gt; &gt; Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/Dashboard.js:68
&gt; &gt; +    _sortedItems: function(unsorted)
&gt; &gt; +    {
&gt; &gt; +        var sorted = [];
&gt; &gt; +
&gt; &gt; +        for (var key in unsorted)
&gt; &gt; +            sorted.push(unsorted[key]);
&gt; &gt; +
&gt; &gt; +        sorted.sort(function(a, b) {
&gt; &gt; +            return a.order - b.order;
&gt; &gt; +        });
&gt; &gt; +
&gt; &gt; +        return sorted;
&gt; 
&gt; Please make this a free function. Additionally, the name of this function is
&gt; disingenuous given the presence of its argument. Specifically the use of the
&gt; past tense word &quot;sorted&quot; implies the function is a getter and/or sorts some
&gt; kind of global data &quot;items&quot;. But it takes an unsorted array as its argument
&gt; and sorts this argument. Functions that perform a computation should have a
&gt; name that begins with a verb. Maybe sortDictionaryByOrder()? Can we come up
&gt; with a better name?</span >

Okay, but it's not really sorting a dictionary. It's really sorting an array of dictionaries or objects that happen to have an `order` key or property. Maybe `sortArrayByOrder` or `sortDictionariesByOrder` or `sortObjectsByOrder`?

Also, there is a Utilities.js file. Do you think this should go there?</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>