mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-15 10:21:45 -04:00
flatten converted values *after* recursive conversion, not instead of
This commit is contained in:
parent
fa5c66907d
commit
5b09d44944
@ -146,11 +146,6 @@ private[oc] object Registry extends api.detail.DriverAPI {
|
||||
memo += arg -> 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 {
|
||||
// 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
|
||||
@ -163,10 +158,17 @@ private[oc] object Registry extends api.detail.DriverAPI {
|
||||
memo += converted -> converted // Makes convertMap re-use the map.
|
||||
convertRecursively(converted, memo, force = true)
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
def convertList(obj: AnyRef, list: Iterator[(Any, Int)], memo: util.IdentityHashMap[AnyRef, AnyRef]) = {
|
||||
val converted = mutable.ArrayBuffer.empty[AnyRef]
|
||||
|
Loading…
x
Reference in New Issue
Block a user