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

Side by Side Diff: regexp2000/src/list-inl.h

Issue 9110: Experimental: Fixed bug in RegExp Parser. Added feature counting in parser. (Closed)
Patch Set: Merged changes to tip of experimental branch. Created 12 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « regexp2000/src/list.h ('k') | regexp2000/src/parser.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 } 83 }
84 84
85 85
86 template<typename T, class P> 86 template<typename T, class P>
87 void List<T, P>::Iterate(void (*callback)(T* x)) { 87 void List<T, P>::Iterate(void (*callback)(T* x)) {
88 for (int i = 0; i < length_; i++) callback(&data_[i]); 88 for (int i = 0; i < length_; i++) callback(&data_[i]);
89 } 89 }
90 90
91 91
92 template<typename T, class P> 92 template<typename T, class P>
93 bool List<T, P>::Contains(T& elm) { 93 bool List<T, P>::Contains(const T& elm) {
94 for (int i = 0; i < length_; i++) { 94 for (int i = 0; i < length_; i++) {
95 if (data_[i] == elm) 95 if (data_[i] == elm)
96 return true; 96 return true;
97 } 97 }
98 return false; 98 return false;
99 } 99 }
100 100
101 101
102 template<typename T, class P> 102 template<typename T, class P>
103 void List<T, P>::Sort(int (*cmp)(const T* x, const T* y)) { 103 void List<T, P>::Sort(int (*cmp)(const T* x, const T* y)) {
(...skipping 13 matching lines...) Expand all
117 ASSERT(capacity >= 0); 117 ASSERT(capacity >= 0);
118 data_ = (capacity > 0) ? NewData(capacity) : NULL; 118 data_ = (capacity > 0) ? NewData(capacity) : NULL;
119 capacity_ = capacity; 119 capacity_ = capacity;
120 length_ = 0; 120 length_ = 0;
121 } 121 }
122 122
123 123
124 } } // namespace v8::internal 124 } } // namespace v8::internal
125 125
126 #endif // V8_LIST_INL_H_ 126 #endif // V8_LIST_INL_H_
OLDNEW
« no previous file with comments | « regexp2000/src/list.h ('k') | regexp2000/src/parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698