serialize: change to "<" to match the comments.

db4
John Benediktsson 2015-08-08 17:17:07 -07:00
parent 0bdc27053b
commit 4962151111
1 changed files with 3 additions and 3 deletions

View File

@ -38,11 +38,11 @@ SYMBOL: serialized
! otherwise be confused with a small number. ! otherwise be confused with a small number.
: serialize-cell ( n -- ) : serialize-cell ( n -- )
[ 0 write1 ] [ [ 0 write1 ] [
dup 0x7e <= [ dup 0x7f < [
0x80 bitor write1 0x80 bitor write1
] [ ] [
dup log2 8 /i 1 + dup log2 8 /i 1 +
dup 0x81 >= [ dup 0x80 > [
0xff write1 0xff write1
dup serialize-cell dup serialize-cell
] [ ] [
@ -55,7 +55,7 @@ SYMBOL: serialized
: deserialize-cell ( -- n ) : deserialize-cell ( -- n )
read1 { read1 {
{ [ dup 0xff = ] [ drop deserialize-cell read be> ] } { [ dup 0xff = ] [ drop deserialize-cell read be> ] }
{ [ dup 0x81 >= ] [ 0x80 bitxor ] } { [ dup 0x80 > ] [ 0x80 bitxor ] }
[ read be> ] [ read be> ]
} cond ; } cond ;