Skip to content

Commit 7154b58

Browse files
committed
fix up comparison
1 parent 3857456 commit 7154b58

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

editor.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@ namespace microcode {
297297
if (true) {
298298
progToString(this.progdef)
299299
const pas1 = progToStringRet
300+
const buf1 = this.progdef.toBuffer()
300301
// console.log(`PAS1\n${pas1}`)
301302
parseProg(pas1)
302303
const progFromString = parseProgRet
@@ -305,14 +306,14 @@ namespace microcode {
305306
const pas2 = progToStringRet
306307
// check the programs are the same
307308
for (let i = 0; i < buf.length && i < buf2.length; i++) {
308-
if (buf[i] != buf2[i]) {
309+
if (buf1[i] != buf2[i]) {
309310
control.assert(
310311
false,
311312
`buf/buf2[${i}] = ${buf[i]}/${buf2[i]}`
312313
)
313314
}
314315
}
315-
assert(buf.length == buf2.length, `bufs not same length`)
316+
assert(buf1.length == buf2.length, `bufs not same length`)
316317
}
317318
}
318319
this.configureP1Keys()

0 commit comments

Comments
 (0)