Skip to content
Browse files

better checks for container emptiness

  • Loading branch information...
1 parent 5cb7a7d commit 526b2dab6e35fa89de351198648568aad6708cbb @nazgob nazgob committed Jun 18, 2011
Showing with 4 additions and 4 deletions.
  1. +2 −2 vm/gc/baker.cpp
  2. +1 −1 vm/gc/walker.cpp
  3. +1 −1 vm/llvm/jit.cpp
View
4 vm/gc/baker.cpp
@@ -342,8 +342,8 @@ namespace rubinius {
}
void BakerGC::handle_promotions() {
- while(promoted_stack_.size() > 0 || !fully_scanned_p()) {
- while(promoted_stack_.size() > 0) {
+ while(!promoted_stack_.empty() || !fully_scanned_p()) {
+ while(!promoted_stack_.empty()) {
Object* obj = promoted_stack_.back();
promoted_stack_.pop_back();
View
2 vm/gc/walker.cpp
@@ -102,7 +102,7 @@ namespace rubinius {
}
Object* ObjectWalker::next() {
- if(stack_.size() == 0) return 0;
+ if(stack_.empty()) return 0;
Object* obj = stack_.back();
stack_.pop_back();
View
2 vm/llvm/jit.cpp
@@ -272,7 +272,7 @@ namespace rubinius {
// If we've been asked to stop, do so now.
if(stop_) return;
- while(pending_requests_.size() == 0) {
+ while(pending_requests_.empty()) {
state = cIdle;
// unlock and wait...

0 comments on commit 526b2da

Please sign in to comment.
Something went wrong with that request. Please try again.