Skip to content

Commit 6073011

Browse files
committed
Remove useless chr calls in DNS parser
1 parent 3ea6da7 commit 6073011

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Protocol/Parser.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@ public function parseHeader(Message $message)
4848

4949
list($id, $fields, $qdCount, $anCount, $nsCount, $arCount) = array_merge(unpack('n*', $header));
5050

51-
$rcode = $fields & chr(bindec('1111'));
52-
$z = ($fields >> 4) & chr(bindec('111'));
51+
$rcode = $fields & bindec('1111');
52+
$z = ($fields >> 4) & bindec('111');
5353
$ra = ($fields >> 7) & 1;
5454
$rd = ($fields >> 8) & 1;
5555
$tc = ($fields >> 9) & 1;
5656
$aa = ($fields >> 10) & 1;
57-
$opcode = ($fields >> 11) & chr(bindec('1111'));
57+
$opcode = ($fields >> 11) & bindec('1111');
5858
$qr = ($fields >> 15) & 1;
5959

6060
$vars = compact('id', 'qdCount', 'anCount', 'nsCount', 'arCount',

0 commit comments

Comments
 (0)