Bug 1081598: Eliminate silly ternary expressions. r=rnewman
authorChris Kitching <chriskitching@linux.com>
Sun, 12 Oct 2014 02:11:40 +0100
changeset 210000 e811af3754be45b84846faf3a4076d82b3b5a9e3
parent 209999 0dc0ff9bb484b2782786bdc4ee73be80f5048ab6
child 210001 a7f7455aad1a6d0d4e10e94a2edcec67941b91e0
push id27634
push userryanvm@gmail.com
push dateSun, 12 Oct 2014 18:44:46 +0000
treeherdermozilla-central@5ec529e71a22 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrnewman
bugs1081598
milestone35.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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);