Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/torch/nngraph.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMalcolm Reynolds <mareynolds@google.com>2016-01-29 14:15:53 +0300
committerMalcolm Reynolds <mareynolds@google.com>2016-01-29 14:15:53 +0300
commit3e84c827f635ee516c17d5374360501626ced13d (patch)
tree970524ed565443f88e0801e7d477aacf3e2c38bb
parentb43cc8247fc789fed63f86e5aaa91582f1e15450 (diff)
Change copyNested to error when there are extra keys in output.
-rw-r--r--nesting.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/nesting.lua b/nesting.lua
index e1ddd7b..a58066b 100644
--- a/nesting.lua
+++ b/nesting.lua
@@ -59,10 +59,10 @@ function nesting.copyNested(output, input)
for key, child in pairs(input) do
nesting.copyNested(output[key], child)
end
- -- Extra elements are removed from the output.
+ -- Extra elements in the output table cause an error.
for key, child in pairs(output) do
if not input[key] then
- output[key] = nil
+ error('key ' .. key .. ' present in output but not in input')
end
end
end