Skip to content

Commit 4fb80ed

Browse files
committed
Keep simple condtion and unused assetions
1 parent 35f8b3c commit 4fb80ed

2 files changed

Lines changed: 1 addition & 2 deletions

File tree

src/HJSON/HJSONParser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ private function keyname()
333333

334334
while (true) {
335335
if ($this->ch === ':') {
336-
if (!$name && $name != 0) $this->error("Found ':' but no key name (for an empty key name use quotes)");
336+
if ($name === '') $this->error("Found ':' but no key name (for an empty key name use quotes)");
337337
else if ($space >=0 && $space !== mb_strlen($name)) {
338338
$this->at = $start + $space;
339339
$this->error("Found whitespace in your key name (use quotes to include)");

tests/HJSONParserTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ private function runEach($name, $file, $isJson, $inputCr, $outputCr)
5656
$this->assertEquals($json1, $json2);
5757
}
5858
}
59-
else $this->assertFalse(false);
6059
}
6160
catch (HJSONException $e) {
6261
if (!$shouldFail) throw $e;

0 commit comments

Comments
 (0)