diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..e473a031c --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.java linguist-language=java \ No newline at end of file diff --git a/nsfw/src/main/java/com/zwy/nsfw/Classifier.java b/nsfw/src/main/java/com/zwy/nsfw/Classifier.java index d14312f72..a23d94af4 100644 --- a/nsfw/src/main/java/com/zwy/nsfw/Classifier.java +++ b/nsfw/src/main/java/com/zwy/nsfw/Classifier.java @@ -152,8 +152,7 @@ private void convertBitmapToByteBuffer(Bitmap bitmap_) { bitmap_.getPixels(intValues, 0, INPUT_WIDTH, h_off, w_off, INPUT_WIDTH, INPUT_HEIGHT); // Convert the image to floating point. long startTime = SystemClock.uptimeMillis(); - for (int i = 0; i < intValues.length; i++) { - final int color = intValues[i]; + for (final int color : intValues) { int r1 = Color.red(color); int g1 = Color.green(color); int b1 = Color.blue(color);