mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-14 09:46:53 -04:00
Merge branch 'recursive-flatten' of https://github.com/benblank/OpenComputers into master-MC1.7.10
This commit is contained in:
commit
30e37daba6
@ -146,11 +146,6 @@ private[oc] object Registry extends api.detail.DriverAPI {
|
|||||||
memo += arg -> null
|
memo += arg -> null
|
||||||
null
|
null
|
||||||
}
|
}
|
||||||
else if (converted.size == 1 && converted.containsKey("oc:flatten")) {
|
|
||||||
val value = converted.get("oc:flatten")
|
|
||||||
memo += arg -> value // Update memoization map.
|
|
||||||
value
|
|
||||||
}
|
|
||||||
else {
|
else {
|
||||||
// This is a little nasty but necessary because we need to keep the
|
// This is a little nasty but necessary because we need to keep the
|
||||||
// 'converted' value up-to-date for any reference created to it in
|
// 'converted' value up-to-date for any reference created to it in
|
||||||
@ -163,10 +158,17 @@ private[oc] object Registry extends api.detail.DriverAPI {
|
|||||||
memo += converted -> converted // Makes convertMap re-use the map.
|
memo += converted -> converted // Makes convertMap re-use the map.
|
||||||
convertRecursively(converted, memo, force = true)
|
convertRecursively(converted, memo, force = true)
|
||||||
memo -= converted
|
memo -= converted
|
||||||
|
if (converted.size == 1 && converted.containsKey("oc:flatten")) {
|
||||||
|
val value = converted.get("oc:flatten")
|
||||||
|
memo += arg -> value // Update memoization map.
|
||||||
|
value
|
||||||
|
}
|
||||||
|
else {
|
||||||
converted
|
converted
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
def convertList(obj: AnyRef, list: Iterator[(Any, Int)], memo: util.IdentityHashMap[AnyRef, AnyRef]) = {
|
def convertList(obj: AnyRef, list: Iterator[(Any, Int)], memo: util.IdentityHashMap[AnyRef, AnyRef]) = {
|
||||||
val converted = mutable.ArrayBuffer.empty[AnyRef]
|
val converted = mutable.ArrayBuffer.empty[AnyRef]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user