don't do useless copies in initialization

This commit is contained in:
dzaima 2022-08-18 08:23:20 +03:00
parent e49fcd3449
commit 3e9093af7b

11
cc.bqn
View File

@ -30,15 +30,16 @@ OAny ← ≡◶⟨@⊸≤◶ONum‿OChr, OStr, ⊑⟩
List (0<)"",1·","¨
ShortList {"m_lv"𝕨"_"(F𝕩)"("(List𝕩)")"}
LongList {"m_ca"𝕨"("(F𝕩)",("𝕨"[]){"(List𝕩)"})"}
MakeList (>4˙)ShortListLongList
Li {"i32" MakeList F¨𝕩}
_Lo {"B" MakeList 𝔽¨𝕩}
ConstList {"m_ca"𝕨"("(F𝕩)",({static "𝕨" l_[]={"(List𝕩)"};l_;}))"}
_makeList {𝕨 (>4˙)ShortList,𝕗LongListConstList 𝕩}
Li {"i32" 1 _makeList F¨𝕩}
_Lo {"B" 0 _makeList 𝔽¨𝕩}
glyphs Import "glyphs.bqn"
_getComp { (4+2×useInd) <˜ 5 (𝕗 Import "c.bqn"){𝔽} }
useInd "-i"args args˜useInd
Comp ((<"inc(runtime["F"])"˙)¨glyphs) glyphs _getComp
Comp ((<"incG(runtime["F"])"˙)¨glyphs) glyphs _getComp
J (@+10)¨
Fout {((𝕩)Li OAny _Lo =ONum,Li _Lo _Lo _Lo (Li 2) _Lo Li _Lo OStr) {𝕎𝕩}¨ 𝕩}
@ -48,7 +49,7 @@ LFC ← Long∘Fout∘Comp
RT {
srcneedinputs𝕩Import"pr.bqn"
pr"runtime_0""provide"{(𝕨<(<{"inc("𝕨"["𝕩"])"}F¨)()¨𝕩)˜(𝕩)need}((-1+1=𝕩))inputs
pr"runtime_0""provide"{(𝕨<(<{"incG("𝕨"["𝕩"])"}F¨)()¨𝕩)˜(𝕩)need}((-1+1=𝕩))inputs
Long Fout pr need _getComp src
}
CArg {J (¯5𝕩˙) FLines "c.bqn"}