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

Unified Diff: third_party/google_input_tools/third_party/closure_library/closure/goog/structs/map.js

Issue 1257313003: Update Google Input Tools (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Free up grd resources. Created 5 years, 5 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
Index: third_party/google_input_tools/third_party/closure_library/closure/goog/structs/map.js
diff --git a/third_party/google_input_tools/third_party/closure_library/closure/goog/structs/map.js b/third_party/google_input_tools/third_party/closure_library/closure/goog/structs/map.js
index 6db80fba4b336dd1c0e1f5111abed873caaba331..6e35c62a77c6c73785ecbc2408d9e0fa2a0eaac8 100644
--- a/third_party/google_input_tools/third_party/closure_library/closure/goog/structs/map.js
+++ b/third_party/google_input_tools/third_party/closure_library/closure/goog/structs/map.js
@@ -16,7 +16,6 @@
* @fileoverview Datastructure: Hash Map.
*
* @author arv@google.com (Erik Arvidsson)
- * @author jonp@google.com (Jon Perlow) Optimized for IE6
*
* This file contains an implementation of a Map structure. It implements a lot
* of the methods used in goog.structs so those functions work on hashes. This
@@ -61,7 +60,7 @@ goog.structs.Map = function(opt_map, var_args) {
* This array can contain deleted keys so it's necessary to check the map
* as well to see if the key is still in the map (this doesn't require a
* memory allocation in IE).
- * @private {!Array.<string>}
+ * @private {!Array<string>}
*/
this.keys_ = [];
@@ -102,7 +101,7 @@ goog.structs.Map.prototype.getCount = function() {
/**
* Returns the values of the map.
- * @return {!Array.<V>} The values in the map.
+ * @return {!Array<V>} The values in the map.
*/
goog.structs.Map.prototype.getValues = function() {
this.cleanupKeysArray_();
@@ -118,11 +117,11 @@ goog.structs.Map.prototype.getValues = function() {
/**
* Returns the keys of the map.
- * @return {!Array.<string>} Array of string values.
+ * @return {!Array<string>} Array of string values.
*/
goog.structs.Map.prototype.getKeys = function() {
this.cleanupKeysArray_();
- return /** @type {!Array.<string>} */ (this.keys_.concat());
+ return /** @type {!Array<string>} */ (this.keys_.concat());
};
@@ -335,7 +334,7 @@ goog.structs.Map.prototype.addAll = function(map) {
/**
* Calls the given function on each entry in the map.
- * @param {function(this:T, V, K, goog.structs.Map.<K,V>)} f
+ * @param {function(this:T, V, K, goog.structs.Map<K,V>)} f
* @param {T=} opt_obj The value of "this" inside f.
* @template T
*/
@@ -426,23 +425,19 @@ goog.structs.Map.prototype.__iterator__ = function(opt_keys) {
this.cleanupKeysArray_();
var i = 0;
- var keys = this.keys_;
- var map = this.map_;
var version = this.version_;
var selfObj = this;
var newIter = new goog.iter.Iterator;
newIter.next = function() {
- while (true) {
- if (version != selfObj.version_) {
- throw Error('The map has changed since the iterator was created');
- }
- if (i >= keys.length) {
- throw goog.iter.StopIteration;
- }
- var key = keys[i++];
- return opt_keys ? key : map[key];
+ if (version != selfObj.version_) {
+ throw Error('The map has changed since the iterator was created');
+ }
+ if (i >= selfObj.keys_.length) {
+ throw goog.iter.StopIteration;
}
+ var key = selfObj.keys_[i++];
+ return opt_keys ? key : selfObj.map_[key];
};
return newIter;
};

Powered by Google App Engine
This is Rietveld 408576698