[SERVER-3727] minor btree cleanups Created: 30/Aug/11  Updated: 11/Jul/16  Resolved: 14/Sep/11

Status: Closed
Project: Core Server
Component/s: Index Maintenance
Affects Version/s: None
Fix Version/s: 2.1.0

Type: Improvement Priority: Major - P3
Reporter: Aaron Staple Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 Description   

These are just minor code cleanups - wanted to track somewhere. Anyone feel free to add stuff (I will if I see more issues), though major architectural changes should probably be separate tickets.

ss << " parent: " << this->parent.toString() << endl;
ss << " nextChild: " << this->parent.toString() << endl;

logging nextChild incorrectly.

BTREE(this->nextChild)>parent.writing() = this>parent;

BTREE(this->nextChild)>parent.writing() = this>parent;
//(static_cast<DiskLoc>(this->nextChild).btree<V>())>parent.writing() = this>parent;

We are signaling write intent and assigning twice

// Because lchild is a descendant of thisLoc, updating thisLoc will
// not not affect packing or keys of lchild and kn will be stable
// during the following setInternalKey()

Double not

// make a this->new this->parent if we were the root

???

operator DiskLoc() const

{ // endian if( isNull() ) return DiskLoc(); unsigned a = *((unsigned *) (_a-1)); return DiskLoc(a >> 8, ofs); }

Should return const DiskLoc



 Comments   
Comment by Guanqun Lu [ 26/Sep/11 ]

found another trivial cleanup...

delete the un-needed return statement. pull request here: https://github.com/mongodb/mongo/pull/92

diff --git a/db/btree.cpp b/db/btree.cpp
index 823ab59..ff53882 100644
— a/db/btree.cpp
+++ b/db/btree.cpp
@@ -1337,7 +1337,6 @@ namespace mongo

{ if ( !rchild.isNull() ) rchild.btree<V>()->parent.writing() = thisLoc; }
  • return;
    }
    }
Comment by auto [ 13/Sep/11 ]

Author:

{u'login': u'astaple', u'name': u'Aaron', u'email': u'aaron@10gen.com'}

Message: SERVER-3727 minor btree cleanups
Branch: master
https://github.com/mongodb/mongo/commit/7a8fa525bb65eedc027cfcbbd783a7e83f5f0319

Generated at Thu Feb 08 03:03:53 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.