diff options
author | Dwight <dmerriman@gmail.com> | 2008-12-17 12:23:06 -0500 |
---|---|---|
committer | Dwight <dmerriman@gmail.com> | 2008-12-17 12:23:06 -0500 |
commit | 1d8082574af3844607a882b8d953cd1843235509 (patch) | |
tree | 77d8a9d5a212e45a9d52558061c731d18342eb16 /db/storage.h | |
parent | 1c29b8aae48c16600141242f8c2754a5475070c3 (diff) | |
download | mongo-1d8082574af3844607a882b8d953cd1843235509.tar.gz |
clean up compare for diskloc class a little had some dup code
Diffstat (limited to 'db/storage.h')
-rw-r--r-- | db/storage.h | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/db/storage.h b/db/storage.h index 2ce70926c10..5e4f43f77f3 100644 --- a/db/storage.h +++ b/db/storage.h @@ -89,14 +89,9 @@ public: int x = fileNo - b.fileNo; if( x ) return x; - if( ofs == b.ofs ) return 0; - return ofs < b.ofs ? -1 : 1; - } - bool operator<(const DiskLoc& b) const { - if( fileNo == b.fileNo ) - return ofs < b.ofs; - return fileNo < b.fileNo; + return ofs - b.ofs; } + bool operator<(const DiskLoc& b) const { return compare(b) < 0; } /* get the "thing" associated with this disk location. it is assumed the object is what it is -- you must asure that: |