Compiler update (#21)
* added seperate folders for cmd packages. * Fix netmodes in test + reverse bigint bytes * glide get deps * add, sub, mul, div * booleans * strings * binary expressions * if statements * function calls * composite literals (slice, array) * Added lots of test cases and update readme.
This commit is contained in:
parent
f7d57e4e49
commit
b257a06f3e
18 changed files with 1253 additions and 494 deletions
|
@ -45,8 +45,12 @@ func Uint256DecodeFromBytes(b []byte) (Uint256, error) {
|
|||
|
||||
// ToArrayReverse return a reversed version of the given byte slice.
|
||||
func ToArrayReverse(b []byte) []byte {
|
||||
dest := make([]byte, len(b))
|
||||
// Protect from big.Ints that have 1 len bytes.
|
||||
if len(b) < 2 {
|
||||
return b
|
||||
}
|
||||
|
||||
dest := make([]byte, len(b))
|
||||
for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
|
||||
dest[i], dest[j] = b[j], b[i]
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue