Changeset 10001 in josm for trunk/src/org/openstreetmap/josm/tools
- Timestamp:
- 2016-03-17T01:50:12+01:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/Diff.java
r9231 r10001 177 177 for (int c = 1;; ++c) { 178 178 int d; /* Active diagonal. */ 179 boolean big _snake = false;179 boolean bigSnake = false; 180 180 181 181 /* Extend the top-down search by an edit step in each diagonal. */ … … 204 204 } 205 205 if (x - oldx > SNAKE_LIMIT) { 206 big _snake = true;206 bigSnake = true; 207 207 } 208 208 fd[fdiagoff + d] = x; … … 238 238 } 239 239 if (oldx - x > SNAKE_LIMIT) { 240 big _snake = true;240 bigSnake = true; 241 241 } 242 242 bd[bdiagoff + d] = x; … … 255 255 of changes, the algorithm is linear in the file size. */ 256 256 257 if (c > 200 && big _snake && heuristic) {257 if (c > 200 && bigSnake && heuristic) { 258 258 int best = 0; 259 259 int bestpos = -1; … … 618 618 */ 619 619 int[] equivCount() { 620 int[] equiv _count = new int[equivMax];620 int[] equivCount = new int[equivMax]; 621 621 for (int i = 0; i < bufferedLines; ++i) { 622 ++equiv _count[equivs[i]];623 } 624 return equiv _count;622 ++equivCount[equivs[i]]; 623 } 624 return equivCount; 625 625 } 626 626 … … 853 853 void shift_boundaries(FileData f) { 854 854 final boolean[] changed = changedFlag; 855 final boolean[] other _changed = f.changedFlag;855 final boolean[] otherChanged = f.changedFlag; 856 856 int i = 0; 857 857 int j = 0; 858 int i _end = bufferedLines;858 int iEnd = bufferedLines; 859 859 int preceding = -1; 860 int other _preceding = -1;860 int otherPreceding = -1; 861 861 862 862 for (;;) { 863 int start, end, other _start;863 int start, end, otherStart; 864 864 865 865 /* Scan forwards to find beginning of another run of changes. 866 866 Also keep track of the corresponding point in the other file. */ 867 867 868 while (i < i _end && !changed[1+i]) {869 while (other _changed[1+j++]) {868 while (i < iEnd && !changed[1+i]) { 869 while (otherChanged[1+j++]) { 870 870 /* Non-corresponding lines in the other file 871 871 will count as the preceding batch of changes. */ 872 other _preceding = j;872 otherPreceding = j; 873 873 } 874 874 i++; 875 875 } 876 876 877 if (i == i _end) {877 if (i == iEnd) { 878 878 break; 879 879 } 880 880 881 881 start = i; 882 other _start = j;882 otherStart = j; 883 883 884 884 for (;;) { 885 885 /* Now find the end of this run of changes. */ 886 886 887 while (i < i _end && changed[1+i]) {887 while (i < iEnd && changed[1+i]) { 888 888 i++; 889 889 } … … 899 899 Only because the previous run was shifted here. */ 900 900 901 if (end != i _end && equivs[start] == equivs[end] && !other_changed[1+j]902 && !((preceding >= 0 && start == preceding) || (other _preceding >= 0 && other_start == other_preceding))) {901 if (end != iEnd && equivs[start] == equivs[end] && !otherChanged[1+j] 902 && !((preceding >= 0 && start == preceding) || (otherPreceding >= 0 && otherStart == otherPreceding))) { 903 903 changed[1+end++] = true; 904 904 changed[1+start++] = false; … … 914 914 915 915 preceding = i; 916 other _preceding = j;916 otherPreceding = j; 917 917 } 918 918 } -
trunk/src/org/openstreetmap/josm/tools/ImageProvider.java
r9949 r10001 753 753 extensions = new String[] {".png", ".svg"}; 754 754 } 755 final int ARCHIVE = 0, LOCAL = 1; 756 for (int place : new Integer[] {ARCHIVE, LOCAL}) { 755 final int typeArchive = 0; 756 final int typeLocal = 1; 757 for (int place : new Integer[] {typeArchive, typeLocal}) { 757 758 for (String ext : extensions) { 758 759 … … 777 778 778 779 switch (place) { 779 case ARCHIVE:780 case typeArchive: 780 781 if (archive != null) { 781 782 ir = getIfAvailableZip(fullName, archive, inArchiveDir, type); … … 786 787 } 787 788 break; 788 case LOCAL:789 case typeLocal: 789 790 // getImageUrl() does a ton of "stat()" calls and gets expensive 790 791 // and redundant when you have a whole ton of objects. So, … … 924 925 } 925 926 } else { 926 final String fn _md5 = Utils.md5Hex(fn);927 url = b + fn _md5.substring(0, 1) + '/' + fn_md5.substring(0, 2) + "/" + fn;927 final String fnMD5 = Utils.md5Hex(fn); 928 url = b + fnMD5.substring(0, 1) + '/' + fnMD5.substring(0, 2) + "/" + fn; 928 929 } 929 930 result = getIfAvailableHttp(url, type);
Note:
See TracChangeset
for help on using the changeset viewer.