diff options
author | Samuel Tardieu <sam@rfc1149.net> | 2012-04-27 17:34:56 +0200 |
---|---|---|
committer | Samuel Tardieu <sam@rfc1149.net> | 2012-04-27 17:34:56 +0200 |
commit | 1660ff191a15f4062819209f28493eacb9153083 (patch) | |
tree | e7157b8b85cfcf9745409514ccb034288a8cebb3 | |
parent | d009c50262354fc9a2d09ba842db00cfe27cfa01 (diff) | |
download | cgeo-1660ff191a15f4062819209f28493eacb9153083.zip cgeo-1660ff191a15f4062819209f28493eacb9153083.tar.gz cgeo-1660ff191a15f4062819209f28493eacb9153083.tar.bz2 |
Refactoring: simplify conditional expressions
-rw-r--r-- | main/src/cgeo/geocaching/cgData.java | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/main/src/cgeo/geocaching/cgData.java b/main/src/cgeo/geocaching/cgData.java index c290917..468dbfa 100644 --- a/main/src/cgeo/geocaching/cgData.java +++ b/main/src/cgeo/geocaching/cgData.java @@ -1227,11 +1227,7 @@ public class cgData { ok = true; } else { final int rows = databaseRW.update(dbTableWaypoints, values, "_id = " + id, null); - if (rows > 0) { - ok = true; - } else { - ok = false; - } + ok = rows > 0; } databaseRW.setTransactionSuccessful(); } finally { @@ -1945,7 +1941,7 @@ public class cgData { cursor.getString(indexLog)); log.id = cursor.getInt(indexLogsId); log.found = cursor.getInt(indexFound); - log.friend = cursor.getInt(indexFriend) == 1 ? true : false; + log.friend = cursor.getInt(indexFriend) == 1; logs.add(log); } if (!cursor.isNull(indexLogImagesId)) { |