Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit aab699f

Browse files
Fix typo
1 parent 48082d6 commit aab699f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

‎data-structures-in-javascript/hash-table.es6.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class HashTable {
1818

1919
remove(key) {
2020
const hash = this.calculateHash(key);
21-
if(this.values.hasOwnProperty(hash) && this.values[hash].hasOwnProperty(key)) {
21+
if(this.values.hasOwnProperty(hash) && this.values[hash].hasOwnProperty(key)) {
2222
delete this.values[hash][key];
2323
this.numberOfValues--;
2424
}
@@ -30,7 +30,7 @@ class HashTable {
3030

3131
search(key) {
3232
const hash = this.calculateHash(key);
33-
if(this.values.hasOwnProperty(hash) && this.values[hash].hasOwnProperty(key)) {
33+
if(this.values.hasOwnProperty(hash) && this.values[hash].hasOwnProperty(key)) {
3434
return this.values[hash][key];
3535
} else {
3636
return null;

‎data-structures-in-javascript/hash-table.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ HashTable.prototype.add = function(key, value) {
1616
};
1717
HashTable.prototype.remove = function(key) {
1818
var hash = this.calculateHash(key);
19-
if(this.values.hasOwnProperty(hash) && this.values[hash].hasOwnProperty(key)) {
19+
if(this.values.hasOwnProperty(hash) && this.values[hash].hasOwnProperty(key)) {
2020
delete this.values[hash][key];
2121
this.numberOfValues--;
2222
}
@@ -26,7 +26,7 @@ HashTable.prototype.calculateHash = function(key) {
2626
};
2727
HashTable.prototype.search = function(key) {
2828
var hash = this.calculateHash(key);
29-
if(this.values.hasOwnProperty(hash) && this.values[hash].hasOwnProperty(key)) {
29+
if(this.values.hasOwnProperty(hash) && this.values[hash].hasOwnProperty(key)) {
3030
return this.values[hash][key];
3131
} else {
3232
return null;

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /