mirror of
https://github.com/urbit/shrub.git
synced 2025-01-03 10:02:32 +03:00
fine: use progressive insertion sort instead of quicksort to assemble fragments
This commit is contained in:
parent
a30cb42038
commit
f68f3dc833
@ -288,8 +288,7 @@
|
||||
^- [sig=@ux dat=$@(~ (cask))]
|
||||
=/ mes=@
|
||||
%+ rep response-size
|
||||
%+ turn
|
||||
(sort hav |=([a=have b=have] (lth fra.a fra.b)))
|
||||
%+ turn (flop hav)
|
||||
|=(=have dat.have)
|
||||
=+ sig=(end 9 mes)
|
||||
:- sig
|
||||
@ -4266,9 +4265,16 @@
|
||||
=^ found=? fine (fi-on-ack num)
|
||||
?. found
|
||||
(fi-fast-retransmit:og num)
|
||||
=: hav.keen [[num meow] hav.keen]
|
||||
num-received.keen +(num-received.keen)
|
||||
==
|
||||
=. num-received.keen +(num-received.keen)
|
||||
=. hav.keen
|
||||
:: insert in reverse order
|
||||
::
|
||||
|- ^- (list have)
|
||||
?~ hav.keen
|
||||
[num meow]~
|
||||
?: (lth num fra.i.hav.keen)
|
||||
[i.hav.keen $(hav.keen t.hav.keen)]
|
||||
[[num meow] hav.keen]
|
||||
?. =(num-fragments num-received):keen
|
||||
fi-continue
|
||||
(fi-done [sig dat]:fi-sift-full)
|
||||
|
Loading…
Reference in New Issue
Block a user