Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
appinventor-sources
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
appinventor-sources
Commits
1822527a
Unverified
Commit
1822527a
authored
Mar 16, 2021
by
AnujSinghal12
Committed by
GitHub
Mar 16, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove if condition converting list-of-lists into dictionary (#2414)
parent
bee418e2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
18 deletions
+4
-18
appinventor/components/src/com/google/appinventor/components/runtime/util/YailDictionary.java
...e/appinventor/components/runtime/util/YailDictionary.java
+1
-10
appinventor/components/tests/com/google/appinventor/components/runtime/util/YailDictionaryTest.java
...pinventor/components/runtime/util/YailDictionaryTest.java
+3
-8
No files found.
appinventor/components/src/com/google/appinventor/components/runtime/util/YailDictionary.java
View file @
1822527a
...
@@ -122,16 +122,7 @@ public class YailDictionary extends LinkedHashMap<Object, Object>
...
@@ -122,16 +122,7 @@ public class YailDictionary extends LinkedHashMap<Object, Object>
for
(
YailList
currentYailList
:
pairs
)
{
for
(
YailList
currentYailList
:
pairs
)
{
Object
currentKey
=
currentYailList
.
getObject
(
0
);
Object
currentKey
=
currentYailList
.
getObject
(
0
);
Object
currentValue
=
currentYailList
.
getObject
(
1
);
Object
currentValue
=
currentYailList
.
getObject
(
1
);
map
.
put
(
currentKey
,
currentValue
);
if
(
currentValue
instanceof
YailList
)
{
if
(
isAlist
((
YailList
)
currentValue
))
{
map
.
put
(
currentKey
,
alistToDict
((
YailList
)
currentValue
));
}
else
{
map
.
put
(
currentKey
,
checkList
((
YailList
)
currentValue
));
}
}
else
{
map
.
put
(
currentKey
,
currentValue
);
}
}
}
return
new
YailDictionary
(
map
);
return
new
YailDictionary
(
map
);
...
...
appinventor/components/tests/com/google/appinventor/components/runtime/util/YailDictionaryTest.java
View file @
1822527a
...
@@ -372,15 +372,10 @@ public class YailDictionaryTest {
...
@@ -372,15 +372,10 @@ public class YailDictionaryTest {
YailList
.
makeList
(
new
Object
[]
{
YailList
.
makeList
(
new
Object
[]
{
YailList
.
makeList
(
new
Object
[]
{
"a"
,
"b"
}),
2
,
3
})}),
YailList
.
makeList
(
new
Object
[]
{
"a"
,
"b"
}),
2
,
3
})}),
YailList
.
makeList
(
new
Object
[]
{
"dict"
,
YailList
.
makeList
(
new
Object
[]
{
"dict"
,
YailDictionary
.
makeDictionary
(
"a"
,
"b"
)}),
YailList
.
makeList
(
new
Object
[]
{
"list-with-dict"
,
YailList
.
makeList
(
new
Object
[]
{
YailList
.
makeList
(
new
Object
[]
{
YailList
.
makeList
(
new
Object
[]
{
"a"
,
"b"
})})}),
YailDictionary
.
makeDictionary
(
"a"
,
"b"
)
YailList
.
makeList
(
new
Object
[]
{
"list-with-dict"
,
YailList
.
makeList
(
new
Object
[]
{
YailList
.
makeList
(
new
Object
[]
{
YailList
.
makeList
(
new
Object
[]
{
"a"
,
"b"
})
})
})})
})})
});
});
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment