small optimization in string handling code

This commit is contained in:
FeralChild64 committed 2020-07-23 16:36:31 +02:00
1 parent 4481320600
commit d6163f7cf7
3 files changed
+8 -9

No files matched your search

+1 -1
View File
@@ -64,7 +64,7 @@ tmpstr_free_loop:
sty DSCPNT+0
phx_trash_a
jsr varstr_free_non_0
jsr varstr_free_no_checks
plx_trash_a
// Mark empty string as free and quit
+1 -1
View File
@@ -28,7 +28,7 @@ tmpstr_free_all_loop:
sta DSCPNT+2
phx_trash_a
jsr varstr_free_non_0
jsr varstr_free_no_checks
plx_trash_a
!:
inx
+6 -7
View File
@@ -16,21 +16,20 @@ varstr_free:
// Check the string size - do not do anything if 0
lda DSCPNT+0
bne varstr_free_non_0
bne !+
rts
varstr_free_non_0: // entry point to be used when it is clear that string is not empty
!:
// Check if string is above FRETOP (in string area)
// XXX move this check out of the routine
jsr helper_cmp_fretop
bcs !+
bcs varstr_free_no_checks
// No, it does not belong to string area - quit
rts
!:
varstr_free_no_checks: // entry point to be used when it is clear that string is not empty and above FRETOP
// Check if this is the lowest string
bne varstr_free_inside