Index: src/d8.cc |
diff --git a/src/d8.cc b/src/d8.cc |
index 3ef0d54d209cea247cb95499e249c8a3b027b5f8..2d30a1c39ab84e0de1f2d28d72a9e4207792e46e 100644 |
--- a/src/d8.cc |
+++ b/src/d8.cc |
@@ -123,26 +123,12 @@ class Symbols { |
}; |
-LineEditor *LineEditor::first_ = NULL; |
+LineEditor *LineEditor::current_ = NULL; |
LineEditor::LineEditor(Type type, const char* name) |
- : type_(type), |
- name_(name), |
- next_(first_) { |
- first_ = this; |
-} |
- |
- |
-LineEditor* LineEditor::Get() { |
- LineEditor* current = first_; |
- LineEditor* best = current; |
- while (current != NULL) { |
- if (current->type_ > best->type_) |
- best = current; |
- current = current->next_; |
- } |
- return best; |
+ : type_(type), name_(name) { |
+ if (current_ == NULL || current_->type_ < type) current_ = this; |
rossberg
2013/02/27 16:32:48
Shouldn't you perhaps delete the current current_
Yang
2013/02/28 12:59:57
Would that be safe? Both DumbLineEditor and ReadLi
|
} |