File tree 1 file changed +1
-12
lines changed
1 file changed +1
-12
lines changed Original file line number Diff line number Diff line change @@ -11,11 +11,6 @@ bstream_class.read_ptr = 1
11
11
function bstream_class :write (v_type , v )
12
12
if type (v_type ) ~= ' string' then return false end
13
13
14
- if v_type == BS_BOOLEAN then
15
- v_type = BS_UINT8
16
- v = v and 1 or 0
17
- end
18
-
19
14
local before = self .bytes :sub (1 , self .write_ptr - 1 )
20
15
local after = self .bytes :sub (self .write_ptr , # self .bytes )
21
16
29
24
function bstream_class :read (v_type , v_len )
30
25
if type (v_type ) ~= ' string' then return false end
31
26
32
- local was_bool = false
33
- if v_type == BS_BOOLEAN then
34
- v_type = BS_UINT8
35
- was_bool = true
36
- end
37
-
38
27
local result = 0
39
28
if v_type == BS_STRING then result = self .bytes :sub (self .read_ptr , self .read_ptr + v_len - 1 )
40
29
else result = bcoder .decode (v_type , self .bytes :sub (self .read_ptr , self .read_ptr + ffi .sizeof (v_type ) - 1 )) end
41
30
42
31
self .read_ptr = self .read_ptr + (v_type == BS_STRING and v_len or ffi .sizeof (v_type ))
43
- return was_bool and ( result == 1 ) or result
32
+ return result
44
33
end
45
34
46
35
function bstream .new (bytes )
You can’t perform that action at this time.
0 commit comments