File tree 1 file changed +6
-4
lines changed
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -380,6 +380,7 @@ public function countPerBucket() {
380
380
381
381
/**
382
382
* returns the hash table as an array
383
+ *
383
384
* @return array
384
385
*/
385
386
public function toArray (): array {
@@ -443,16 +444,17 @@ public function getNodeByKey($key): ?Node {
443
444
* the list is requested from the array based on
444
445
* the array index hash.
445
446
*/
446
- /** @var SinglyLinkedList $list */
447
447
if (!isset ($ this ->bucket [$ arrayIndex ])) {
448
448
return null ;
449
449
}
450
+ /** @var AbstractLinkedList $list */
450
451
$ list = $ this ->bucket [$ arrayIndex ];
451
- if (!$ list ->containsKey ($ key )) {
452
+
453
+ if (!$ list instanceof AbstractLinkedList) {
452
454
return null ;
453
455
}
454
- $ node = $ list -> getNodeByKey ( $ key );
455
- return $ node ;
456
+
457
+ return $ list -> getNodeByKey ( $ key ) ;
456
458
}
457
459
458
460
/**
You can’t perform that action at this time.
0 commit comments