From 467ae8d5e587a020d819b2d2612214e8e6d6ab51 Mon Sep 17 00:00:00 2001 From: Oldes Date: Thu, 29 Jun 2023 18:08:13 +0200 Subject: [PATCH] CHANGE: using more lightweight dynamic function refinements instead of `either` where possible --- src/mezz/mezz-save.reb | 3 ++- src/mezz/mezz-series.reb | 10 +++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/mezz/mezz-save.reb b/src/mezz/mezz-save.reb index 81425a5031..7a5f5cb136 100644 --- a/src/mezz/mezz-save.reb +++ b/src/mezz/mezz-save.reb @@ -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: { @@ -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 [ diff --git a/src/mezz/mezz-series.reb b/src/mezz/mezz-series.reb index bcf64bed76..be56d50206 100644 --- a/src/mezz/mezz-series.reb +++ b/src/mezz/mezz-series.reb @@ -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] ] @@ -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 [ @@ -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