From 5f0de766b28948640f0f17d07163f4dc760772d7 Mon Sep 17 00:00:00 2001 From: jiw <35237843+ghjwp7@users.noreply.github.com> Date: Sun, 12 Jan 2025 22:12:59 -0700 Subject: [PATCH] =?UTF-8?q?Another=20#=C2=A0this=20will=20print=201,=202,?= =?UTF-8?q?=203,=204=20->=20#=C2=A0this=20will=20print=201,=202,=203=20+?= =?UTF-8?q?=20"will=20extract=20modify"=20->=20"will=20modify"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Improving-performance-with-Viper-code.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Improving-performance-with-Viper-code.md b/Improving-performance-with-Viper-code.md index e76a3dd..0090c4d 100644 --- a/Improving-performance-with-Viper-code.md +++ b/Improving-performance-with-Viper-code.md @@ -343,7 +343,7 @@ myfunction( array.array("l", (1,2,3,4))) def myfunction( )->int: int32_array = array.array("l", (1,2,3,4)) x = ptr32( int32_array ) - print(x[0], x[1], x[2] ) # this will print 1, 2, 3, 4 + print(x[0], x[1], x[2] ) # this will print 1, 2, 3 ba = bytearray(10) y = ptr8(ba) y[0] = 1 # This will change ba[0] @@ -398,7 +398,7 @@ If x is a ptr8, x[n] will always be between 0 and 255. * If x is a ptr16, `x[n] = v` will extract the least two significant bytes of the Viper integer `v`and modify the two byte at x[n] -* If x is a ptr32, `x[n] = v` will extract modify the four bytes at `x[n]` with the Viper integer v. +* If x is a ptr32, `x[n] = v` will modify the four bytes at `x[n]` with the Viper integer v. In all cases you will need to convert to a Viper `int` first.