Changeset 5be077e2 for core


Ignore:
Timestamp:
Dec 2, 2016 6:52:37 PM (4 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
f461d48
Parents:
5b31540
Message:

Clean up single char indexOf()

Location:
core/java/src/net/i2p
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • core/java/src/net/i2p/client/naming/HostTxtEntry.java

    r5b31540 r5be077e2  
    118118        for (int i = 0; i < entries.length; i++) {
    119119            String kv = entries[i];
    120             int eq = kv.indexOf("=");
     120            int eq = kv.indexOf('=');
    121121            if (eq <= 0 || eq == kv.length() - 1)
    122122                throw new IllegalArgumentException("No value: \"" + kv + '"');
  • core/java/src/net/i2p/util/Addresses.java

    r5b31540 r5be077e2  
    191191     */
    192192    private static String stripScope(String ip) {
    193         int pct = ip.indexOf("%");
     193        int pct = ip.indexOf('%');
    194194        if (pct > 0)
    195195            ip = ip.substring(0, pct);
  • core/java/src/net/i2p/util/CommandLine.java

    r5b31540 r5be077e2  
    5959        String cmd = args[0].toLowerCase(Locale.US);
    6060        for (String cls : classes) {
    61             String ccmd = cls.substring(cls.lastIndexOf(".") + 1).toLowerCase(Locale.US);
     61            String ccmd = cls.substring(cls.lastIndexOf('.') + 1).toLowerCase(Locale.US);
    6262            if (cmd.equals(ccmd)) {
    6363                try {
     
    8686        List<String> cmds = new ArrayList<String>(classes.size());
    8787        for (String cls : classes) {
    88             String ccmd = cls.substring(cls.lastIndexOf(".") + 1).toLowerCase(Locale.US);
     88            String ccmd = cls.substring(cls.lastIndexOf('.') + 1).toLowerCase(Locale.US);
    8989            cmds.add(ccmd);
    9090        }
Note: See TracChangeset for help on using the changeset viewer.