Skip to content

Commit

Permalink
CHANGE: using more lightweight dynamic function refinements instead o…
Browse files Browse the repository at this point in the history
…f `either` where possible
  • Loading branch information
Oldes committed Jun 29, 2023
1 parent 5fdac4c commit 467ae8d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
3 changes: 2 additions & 1 deletion src/mezz/mezz-save.reb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ REBOL [
Title: "REBOL 3 Mezzanine: Save"
Rights: {
Copyright 2012 REBOL Technologies
Copyright 2012-2023 Rebol Open Source Contributors
REBOL is a trademark of REBOL Technologies
}
License: {
Expand Down Expand Up @@ -95,7 +96,7 @@ save: function [
]

; (Maybe /all should be the default? See CureCode.)
data: either all [mold/all/only :value] [mold/only :value]
data: mold/only/:all :value
append data newline ; mold does not append a newline? Nope.

case/all [
Expand Down
10 changes: 3 additions & 7 deletions src/mezz/mezz-series.reb
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ reword: func [
if wtype <> type? char [char: to wtype char]
[a: any [to char b: char [escape | none]] to end fout]
]
either case [parse/case source rule] [parse source rule]
parse/:case source rule
; Return end of output with /into, head otherwise
either into [output] [head output]
]
Expand Down Expand Up @@ -378,9 +378,7 @@ alter: func [
append series :value true
]
]
to logic! unless remove (
either case [find/case series :value] [find series :value]
) [append series :value]
to logic! unless remove (find/:case series :value) [append series :value]
]

supplement: func [
Expand All @@ -392,9 +390,7 @@ supplement: func [
][
result: series ; to return series at same position if value is found
any[
either case [
find/case series :value
][ find series :value ]
find/:case series :value
append series :value
]
result
Expand Down

0 comments on commit 467ae8d

Please sign in to comment.