Changeset 8a4c469 for apps


Ignore:
Timestamp:
May 31, 2019 3:26:20 PM (17 months ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
1109331
Parents:
b4f331e6
Message:

Blinding: cache b32, sort by b32 on /configkeyring

File:
1 edited

Legend:

Unmodified
Added
Removed
  • apps/routerconsole/java/src/net/i2p/router/web/helpers/ConfigKeyringHelper.java

    rb4f331e6 r8a4c469  
    22
    33import java.io.IOException;
     4import java.io.Serializable;
    45import java.io.StringWriter;
     6import java.util.Collections;
     7import java.util.Comparator;
    58import java.util.List;
    69import java.util.Map;
     
    9093        if (!local) {
    9194            List<BlindData> bdata = _context.netDb().getBlindData();
    92             // TODO sort by hostname
     95            if (bdata.size() > 1)
     96                Collections.sort(bdata, new BDComparator());
    9397            for (BlindData bd : bdata) {
    9498                buf.append("\n<tr><td>");
     
    142146        buf.append("</table>\n");
    143147    }
     148
     149    /** @since 0.9.41 */
     150    private static class BDComparator implements Comparator<BlindData>, Serializable {
     151         public int compare(BlindData l, BlindData r) {
     152             return l.toBase32().compareTo(r.toBase32());
     153        }
     154    }
    144155}
Note: See TracChangeset for help on using the changeset viewer.