From 450f0b23016aab322410ace9ad2d2add5cf490c6 Mon Sep 17 00:00:00 2001 From: Joseph Bryan Date: Thu, 1 Sep 2016 22:39:24 -0400 Subject: [PATCH] refactors ++ta-ser to use ++find --- lib/drum.hoon | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/lib/drum.hoon b/lib/drum.hoon index d32910edcd..f8a241692e 100644 --- a/lib/drum.hoon +++ b/lib/drum.hoon @@ -793,20 +793,15 @@ ++ ta-ser :: reverse search |= ext/(list @c) ^+ +> - ?: |(?=($~ ris) =(0 pos.u.ris)) ta-bel + ?: |(?=($~ ris) =(0 pos.u.ris)) + ta-bel =+ sop=?~(ext (dec pos.u.ris) pos.u.ris) =+ tot=(weld str.u.ris ext) =+ dol=(slag (sub num.hit sop) old.hit) - =+ ^= ser - =+ ^= beg - |= {a/(list @c) b/(list @c)} ^- ? - ?~(a & ?~(b | &(=(i.a i.b) $(a t.a, b t.b)))) - |= {a/(list @c) b/(list @c)} ^- ? - ?~(a & ?~(b | |((beg a b) $(b t.b)))) - =+ ^= sup + =/ sup |- ^- (unit @ud) ?~ dol ~ - ?: (ser tot i.dol) + ?^ (find tot i.dol) `sop $(sop (dec sop), dol t.dol) ?~ sup ta-bel