findbugs: fix loop
This commit is contained in:
parent
2a2ff723ee
commit
6a71e53f93
@ -115,14 +115,14 @@ public class Color {
|
|||||||
|
|
||||||
public static int parseColorComponents(String str) {
|
public static int parseColorComponents(String str) {
|
||||||
int numComponents = 4;
|
int numComponents = 4;
|
||||||
//boolean rgbMode = true;
|
int cur = 5;
|
||||||
|
|
||||||
if (str.startsWith("rgb("))
|
if (str.startsWith("rgb(")) {
|
||||||
numComponents = 3;
|
numComponents = 3;
|
||||||
else if (!str.startsWith("rgba("))
|
cur = 4;
|
||||||
|
} else if (!str.startsWith("rgba("))
|
||||||
parseColorException(str);
|
parseColorException(str);
|
||||||
|
|
||||||
int cur = 4;
|
|
||||||
int end = str.length();
|
int end = str.length();
|
||||||
int component = 0;
|
int component = 0;
|
||||||
int a = 0, r = 0, g = 0, b = 0;
|
int a = 0, r = 0, g = 0, b = 0;
|
||||||
@ -130,7 +130,7 @@ public class Color {
|
|||||||
if (str.charAt(end - 1) != ')')
|
if (str.charAt(end - 1) != ')')
|
||||||
parseColorException(str);
|
parseColorException(str);
|
||||||
|
|
||||||
while (cur < end) {
|
for (; cur < end; cur++) {
|
||||||
char c = str.charAt(cur);
|
char c = str.charAt(cur);
|
||||||
if (c == ',') {
|
if (c == ',') {
|
||||||
component++;
|
component++;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user