summaryrefslogtreecommitdiff
path: root/src/btree
diff options
context:
space:
mode:
authorKeith Bostic <keith@wiredtiger.com>2016-02-22 16:15:42 -0500
committerKeith Bostic <keith@wiredtiger.com>2016-02-22 16:15:42 -0500
commit2f97924854d03be882eb04d85f1374e703794639 (patch)
treecbb121c9bde80b212ea4bb0e6c939f089758c5e8 /src/btree
parentb27cac37d6b05157b65c07f7c85faf85f17f5f9e (diff)
downloadmongo-2f97924854d03be882eb04d85f1374e703794639.tar.gz
SERVER-22784: Coverity analysis defect 77722: Unused value
The variable "couple" is assigned, but we jump to a label where it's assigned again, before it's used. I don't want to change the original assignment, I think it adds clarity to set couple, couple_orig and ref in the initial case. Pull the assignment of couple out of the if/else that holds the jumped-to label, instead.
Diffstat (limited to 'src/btree')
-rw-r--r--src/btree/bt_walk.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/btree/bt_walk.c b/src/btree/bt_walk.c
index 55b11d7b2d1..bb8a750d848 100644
--- a/src/btree/bt_walk.c
+++ b/src/btree/bt_walk.c
@@ -583,14 +583,14 @@ restart: /*
break;
}
WT_ERR(ret);
+ couple = ref;
/*
* A new page: configure for traversal of any internal
* page's children, else return the leaf page.
*/
if (WT_PAGE_IS_INTERNAL(ref->page)) {
-descend: couple = ref;
- empty_internal = true;
+descend: empty_internal = true;
/*
* There's a split race when a cursor is setting
@@ -649,7 +649,6 @@ descend: couple = ref;
*/
if (skipleafcntp != NULL ||
LF_ISSET(WT_READ_SKIP_LEAF)) {
- couple = ref;
if (LF_ISSET(WT_READ_SKIP_LEAF))
break;
if (*skipleafcntp > 0) {