Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(167)

Unified Diff: src/d8.cc

Issue 12330171: Simplify line editor choice in d8. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/d8.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
}
« no previous file with comments | « src/d8.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698