Former-commit-id: 72d4d5effac9bec8aa6876bd7bb93c1a6488117b
master
王兵 4 years ago
parent 80530cd934
commit 2a9d7a254d

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -91,17 +91,22 @@ Array.prototype.forAsync = function (callBack, finish) {
* 自定义Map对象
*/
function Map() {
this.keys = new Array();
this.values = new Array();
this.keys = [];
this.values = [];
this.put = function (key, value) {
this.keys.push(key);
this.values.push(value);
var index = this.keys.indexOf(key);
if (index > -1) {
this.values.splice(index, 1, value)
} else {
this.keys.push(key);
this.values.push(value);
}
}
this.remove = function (key) {
var index = this.keys.indexOf(key);
if (index > -1) {
this.keys.splice(index, 1)
this.values.splice(index, 1)
this.keys.splice(index, 1);
this.values.splice(index, 1);
}
}
this.size = function () {

Loading…
Cancel
Save

Powered by TurnKey Linux.