summaryrefslogtreecommitdiff
path: root/src/cursor/cur_std.c
diff options
context:
space:
mode:
authorMichael Cahill <michael.cahill@wiredtiger.com>2013-12-04 23:20:43 +1100
committerMichael Cahill <michael.cahill@wiredtiger.com>2013-12-04 23:20:43 +1100
commit30983e306e24206648a3a7fda2c58a664387fc44 (patch)
tree6d18793c3027762fcb3a17e780549dae5658f263 /src/cursor/cur_std.c
parent215a5ac782ef8a704e07ac2ea71b54b94a753f94 (diff)
downloadmongo-30983e306e24206648a3a7fda2c58a664387fc44.tar.gz
Add a fast path for getting bitmap values from a cursor.
Diffstat (limited to 'src/cursor/cur_std.c')
-rw-r--r--src/cursor/cur_std.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/cursor/cur_std.c b/src/cursor/cur_std.c
index 491b2480b76..b3aee83ef74 100644
--- a/src/cursor/cur_std.c
+++ b/src/cursor/cur_std.c
@@ -316,14 +316,17 @@ __wt_cursor_get_value(WT_CURSOR *cursor, ...)
va_start(ap, cursor);
fmt = F_ISSET(cursor, WT_CURSOR_RAW_OK) ? "u" : cursor->value_format;
- /* Fast path some common cases. */
+ /* Fast path some common cases: single strings, byte arrays and bits. */
if (strcmp(fmt, "S") == 0)
*va_arg(ap, const char **) = cursor->value.data;
else if (strcmp(fmt, "u") == 0) {
value = va_arg(ap, WT_ITEM *);
value->data = cursor->value.data;
value->size = cursor->value.size;
- } else
+ } else if (strcmp(fmt, "t") == 0 ||
+ (isdigit(fmt[0]) && strcmp(fmt + 1, "t") == 0))
+ *va_arg(ap, uint8_t *) = *(uint8_t *)cursor->value.data;
+ else
ret = __wt_struct_unpackv(session,
cursor->value.data, cursor->value.size, fmt, ap);