Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Replaced dodgy in-place substr PIR op with shiny new replace PIR op.
  • Loading branch information
chromatic committed Apr 28, 2010
1 parent c6f7ed3 commit 30ef6fa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/builtins/Str.pir
Expand Up @@ -155,7 +155,7 @@ Increment and Decrement Methods
dec_2:
dec ipos
repl = substr RANGES, ipos, 1
substr str, r1, 1, repl
str = replace str, r1, 1, repl
# if the replacement wasn't a carry, we're done
if orig > repl goto done
carry:
Expand Down Expand Up @@ -186,7 +186,7 @@ Increment and Decrement Methods
inc ipos
.local string repl
repl = substr RANGES, ipos, 1
substr str, r1, 1, repl
str = replace str, r1, 1, repl
# if the replacement wasn't a carry, we're done
if orig < repl goto done
carry:
Expand All @@ -198,7 +198,7 @@ Increment and Decrement Methods
unless repl == '0' goto extend_1
repl = '1'
extend_1:
substr str, r0, 0, repl
str = replace str, r0, 0, repl

done:
.return (str)
Expand Down
3 changes: 1 addition & 2 deletions src/glue/contextuals.pir
Expand Up @@ -8,8 +8,7 @@

# next, strip twigil and search PROCESS package
.local string pkgname
pkgname = clone name
substr pkgname, 1, 1, ''
pkgname = replace name, 1, 1, ''
$P0 = get_hll_global ['PROCESS'], pkgname
unless null $P0 goto done
$P0 = get_global pkgname
Expand Down

0 comments on commit 30ef6fa

Please sign in to comment.