diff options
author | Keith Bostic <keith@wiredtiger.com> | 2012-09-07 17:41:26 +0000 |
---|---|---|
committer | Keith Bostic <keith@wiredtiger.com> | 2012-09-07 17:41:26 +0000 |
commit | 0c60365433310b9a2c5862e17d5d773b87af606f (patch) | |
tree | 106c8e705a22ea08cdaef9c07e2e6162ee2411cc /examples/c | |
parent | b82c978a1c27cf30cd929234095c4bf60e10b7ee (diff) | |
download | mongo-0c60365433310b9a2c5862e17d5d773b87af606f.tar.gz |
Replace cursor.equals with cursor.compare (#314)
Diffstat (limited to 'examples/c')
-rw-r--r-- | examples/c/ex_all.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/examples/c/ex_all.c b/examples/c/ex_all.c index 2157dde981b..ba63970abf5 100644 --- a/examples/c/ex_all.c +++ b/examples/c/ex_all.c @@ -174,13 +174,17 @@ cursor_ops(WT_SESSION *session) { WT_CURSOR *other = NULL; - /*! [Test cursor equality] */ - int equal; - ret = cursor->equals(cursor, other, &equal); - if (equal) { - /* Take some action. */ - } - /*! [Test cursor equality] */ + /*! [Cursor comparison] */ + int compare; + ret = cursor->compare(cursor, other, &compare); + if (compare == 0) { + /* Cursors reference the same key */ + } else if (compare < 0) { + /* Cursor key less than other key */ + } else if (compare > 0) { + /* Cursor key greater than other key */ + } + /*! [Cursor comparison] */ } { |