Skip to content

Commit 425daed

Browse files
committed
Use isset() for performance. Same difference.
1 parent 5d978bb commit 425daed

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Curl/CaseInsensitiveArray.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,8 @@ public function offsetUnset($offset) {
136136
*/
137137
public function offsetGet($offset) {
138138
$offsetlower = strtolower($offset);
139-
return array_key_exists($offsetlower, $this->data) ? $this->data[$offsetlower] : NULL;
139+
// As isset() is false on 'NULL' anyway, use it, and return NULL, faster
140+
return isset($this->data[$offsetlower]) ? $this->data[$offsetlower] : NULL;
140141
}
141142

142143
/**

0 commit comments

Comments
 (0)