small optimization in string handling code
This commit is contained in:
1 parent
4481320600
commit
d6163f7cf7
3 files changed
+8
-9
No files matched your search
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user