aboutsummaryrefslogtreecommitdiffstats
path: root/lib/plum/binary_string.rb
diff options
context:
space:
mode:
authorKazuki Yamaguchi <k@rhe.jp>2015-10-25 18:42:29 +0900
committerKazuki Yamaguchi <k@rhe.jp>2015-10-25 18:42:29 +0900
commit302eb02fd9b97361b44c66c14827bdd82b46bc71 (patch)
tree814b53cb98bd2e5019752ace816c34c81d5a1390 /lib/plum/binary_string.rb
parent4d5d63bc80e13b0449799f721df768bff2088c44 (diff)
downloadplum-302eb02fd9b97361b44c66c14827bdd82b46bc71.tar.gz
improve performance
Diffstat (limited to 'lib/plum/binary_string.rb')
-rw-r--r--lib/plum/binary_string.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/plum/binary_string.rb b/lib/plum/binary_string.rb
index 053be05..8c98693 100644
--- a/lib/plum/binary_string.rb
+++ b/lib/plum/binary_string.rb
@@ -17,7 +17,7 @@ module Plum
# @param pos [Integer] The start position to read.
def uint24(pos = 0)
a, b = byteslice(pos, 3).unpack("nC")
- (a * 0x100) | b
+ (a * 0x100) + b
end
# Reads a 32-bit unsigned integer.