Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(732)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/util/MathUtils.java

Issue 1002883002: Fix up if statement curly braces issues. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/android/java/src/org/chromium/chrome/browser/util/MathUtils.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/util/MathUtils.java b/chrome/android/java/src/org/chromium/chrome/browser/util/MathUtils.java
index 81501d3830d2e930d968095f85d3b0113bb31da9..ad555562d7f1afe50111acd60ba8f3d6ed8278e3 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/util/MathUtils.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/util/MathUtils.java
@@ -24,8 +24,11 @@ public class MathUtils {
public static int clamp(int value, int a, int b) {
int min = (a > b) ? b : a;
int max = (a > b) ? a : b;
- if (value < min) value = min;
- else if (value > max) value = max;
+ if (value < min) {
+ value = min;
+ } else if (value > max) {
+ value = max;
+ }
return value;
}
@@ -42,8 +45,11 @@ public class MathUtils {
public static long clamp(long value, long a, long b) {
long min = (a > b) ? b : a;
long max = (a > b) ? a : b;
- if (value < min) value = min;
- else if (value > max) value = max;
+ if (value < min) {
+ value = min;
+ } else if (value > max) {
+ value = max;
+ }
return value;
}
@@ -60,8 +66,11 @@ public class MathUtils {
public static float clamp(float value, float a, float b) {
float min = (a > b) ? b : a;
float max = (a > b) ? a : b;
- if (value < min) value = min;
- else if (value > max) value = max;
+ if (value < min) {
+ value = min;
+ } else if (value > max) {
+ value = max;
+ }
return value;
}

Powered by Google App Engine
This is Rietveld 408576698