Bug 1081598: Eliminate silly ternary expressions. r=rnewman
authorChris Kitching <chriskitching@linux.com>
Sun, 12 Oct 2014 02:11:40 +0100
changeset 209996 e811af3754be45b84846faf3a4076d82b3b5a9e3
parent 209995 0dc0ff9bb484b2782786bdc4ee73be80f5048ab6
child 209997 a7f7455aad1a6d0d4e10e94a2edcec67941b91e0
push id9324
push userchriskitching@linux.com
push dateSun, 12 Oct 2014 04:12:06 +0000
treeherderfx-team@8bb3624363e5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrnewman
bugs1081598
milestone35.0a1
Bug 1081598: Eliminate silly ternary expressions. r=rnewman * * * Bug 1081598: Eliminate silly ternary expressions. r=rnewman
mobile/android/base/ContactService.java
mobile/android/base/sync/repositories/android/RepoUtils.java
--- a/mobile/android/base/ContactService.java
+++ b/mobile/android/base/ContactService.java
@@ -660,17 +660,17 @@ public class ContactService implements G
                 Log.d(LOGTAG, "Got contact: " + contact.toString(3));
             } catch (JSONException e) {}
         }
 
         return contact;
     }
 
     private boolean bool(int integer) {
-        return integer != 0 ? true : false;
+        return integer != 0;
     }
 
     private void getGenericDataAsJSONObject(Cursor cursor, JSONArray array, final String dataColumn,
                                             final String typeColumn, final String typeLabelColumn,
                                             final HashMap<String, Integer> typeMap) throws JSONException {
         String value = cursor.getString(cursor.getColumnIndex(dataColumn));
         int typeConstant = cursor.getInt(cursor.getColumnIndex(typeColumn));
         String type;
--- a/mobile/android/base/sync/repositories/android/RepoUtils.java
+++ b/mobile/android/base/sync/repositories/android/RepoUtils.java
@@ -189,17 +189,17 @@ public class RepoUtils {
     final long visitCount = getLongFromCursor(cur, BrowserContract.History.VISITS);
     if (visitCount <= 0) {
       Logger.debug(LOG_TAG, "Skipping history record " + guid + " with <= 0 visit count.");
       return null;
     }
 
     final String collection = "history";
     final long lastModified = getLongFromCursor(cur, BrowserContract.SyncColumns.DATE_MODIFIED);
-    final boolean deleted = getLongFromCursor(cur, BrowserContract.SyncColumns.IS_DELETED) == 1 ? true : false;
+    final boolean deleted = getLongFromCursor(cur, BrowserContract.SyncColumns.IS_DELETED) == 1;
 
     final HistoryRecord rec = new HistoryRecord(guid, collection, lastModified, deleted);
 
     rec.androidID         = getLongFromCursor(cur, BrowserContract.History._ID);
     rec.fennecDateVisited = getLongFromCursor(cur, BrowserContract.History.DATE_LAST_VISITED);
     rec.fennecVisitCount  = visitCount;
     rec.histURI           = historyURI;
     rec.title             = getStringFromCursor(cur, BrowserContract.History.TITLE);