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

Unified Diff: content/common/indexed_db/indexed_db_key.cc

Issue 202863004: Fix "unreachable code" warnings (MSVC warning 4702) in content/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 6 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: content/common/indexed_db/indexed_db_key.cc
===================================================================
--- content/common/indexed_db/indexed_db_key.cc (revision 257734)
+++ content/common/indexed_db/indexed_db_key.cc (working copy)
@@ -121,17 +121,24 @@
}
if (array_.size() < other.array_.size())
return -1;
- if (array_.size() > other.array_.size())
- return 1;
- return 0;
+ return (array_.size() > other.array_.size()) ? 1 : 0;
jam 2014/03/19 16:44:36 here, and in line 133 and 138, leave the code as i
jsbell 2014/03/19 16:52:05 I wouldn't object to a follow-up patch that introd
Peter Kasting 2014/03/19 17:50:42 133 and 138 nest ternaries, which has always been
Peter Kasting 2014/03/19 21:10:57 (Splitting this to a separate CL so this CL doesn'
+
jam 2014/03/19 16:44:36 ditto
Peter Kasting 2014/03/19 21:10:57 Done.
case WebIDBKeyTypeBinary:
return binary_.compare(other.binary_);
+
case WebIDBKeyTypeString:
return string_.compare(other.string_);
+
case WebIDBKeyTypeDate:
- return (date_ < other.date_) ? -1 : (date_ > other.date_) ? 1 : 0;
+ if (date_ < other.date_)
+ return -1;
+ return (date_ > other.date_) ? 1 : 0;
+
case WebIDBKeyTypeNumber:
- return (number_ < other.number_) ? -1 : (number_ > other.number_) ? 1 : 0;
+ if (number_ < other.number_)
+ return -1;
+ return (number_ > other.number_) ? 1 : 0;
+
case WebIDBKeyTypeInvalid:
case WebIDBKeyTypeNull:
case WebIDBKeyTypeMin:
@@ -139,8 +146,6 @@
NOTREACHED();
return 0;
}
- NOTREACHED();
- return 0;
}
bool IndexedDBKey::IsLessThan(const IndexedDBKey& other) const {

Powered by Google App Engine
This is Rietveld 408576698