mirror of
https://github.com/QB64-Phoenix-Edition/QB64pe.git
synced 2024-09-20 02:04:44 +00:00
Optimize string addition somewhat to reduce IDE lag
Very simple change here, to basically take: a$ = b$ + c$ + d$ + e$ + f$ And make it: a$ = b$ + (c$ + d$ + e$) + f$ .... This speeds up the IDE due to (c$ + d$ + e$) being small strings, while a$ and f$ are larger strings... It's more efficient to move and add those small strings first, than it is to add them to the large strings, making them larger, at each step.
This commit is contained in:
parent
eff5f84e89
commit
6a895f8405
1 changed files with 2 additions and 2 deletions
|
@ -11856,7 +11856,7 @@ SUB ideinsline (i, text$)
|
||||||
idegotoline i
|
idegotoline i
|
||||||
'insert line
|
'insert line
|
||||||
textlen = LEN(text$)
|
textlen = LEN(text$)
|
||||||
idet$ = LEFT$(idet$, ideli - 1) + MKL$(textlen) + text$ + MKL$(textlen) + RIGHT$(idet$, LEN(idet$) - ideli + 1)
|
idet$ = LEFT$(idet$, ideli - 1) + (MKL$(textlen) + text$ + MKL$(textlen)) + RIGHT$(idet$, LEN(idet$) - ideli + 1)
|
||||||
iden = iden + 1
|
iden = iden + 1
|
||||||
END SUB
|
END SUB
|
||||||
|
|
||||||
|
@ -12536,7 +12536,7 @@ SUB idesetline (i, text$)
|
||||||
|
|
||||||
IF i <> -1 THEN idegotoline i
|
IF i <> -1 THEN idegotoline i
|
||||||
textlen = LEN(text$)
|
textlen = LEN(text$)
|
||||||
idet$ = LEFT$(idet$, ideli - 1) + MKL$(textlen) + text$ + MKL$(textlen) + RIGHT$(idet$, LEN(idet$) - ideli + 1 - CVL(MID$(idet$, ideli, 4)) - 8)
|
idet$ = LEFT$(idet$, ideli - 1) + (MKL$(textlen) + text$ + MKL$(textlen)) + RIGHT$(idet$, LEN(idet$) - ideli + 1 - CVL(MID$(idet$, ideli, 4)) - 8)
|
||||||
|
|
||||||
END SUB
|
END SUB
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue