shithub: mc

Download patch

ref: f52ac3cb5ada4ec50019cf8a09c981c040f56e4d
parent: 398cc4d0f4b41f726d6f734804b504d5bfedf4d9
author: Ori Bernstein <ori@eigenstate.org>
date: Sat May 12 14:56:42 EDT 2018

Remove useless bounds check.

	We already do it when packing the value.

--- a/lib/std/putint.myr
+++ b/lib/std/putint.myr
@@ -39,7 +39,6 @@
 const putbe = {buf, val, n
 	var k
 	
-	iassert(buf.len >= n, "buffer too small")
 	for var i = 0; i < n; i++
 		k = val >> (8*(n-i-1))
 		buf[i] = (k & 0xff: byte)
@@ -48,7 +47,6 @@
 }
 
 const putle = {buf, val, n
-	iassert(buf.len >= n, "buffer too small")
 	for var i = 0; i < n; i++
 		buf[i] = (val & 0xff : byte)
 		val >>= 8