Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Memri
iOS application
Commits
a1cf000b
Commit
a1cf000b
authored
4 years ago
by
Toby Brennan
Browse files
Options
Download
Email Patches
Plain Diff
Fix some compiler warnings for double-wrapped optionals (using flatMap)
parent
ffd068fb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
memri/cvu/views/Action.swift
+4
-3
memri/cvu/views/Action.swift
with
4 additions
and
3 deletions
+4
-3
memri/cvu/views/Action.swift
+
4
-
3
View file @
a1cf000b
...
...
@@ -288,7 +288,7 @@ public class Action: HashableClass, CVUToString {
}
func
get
<
T
>
(
_
key
:
String
,
_
viewArguments
:
ViewArguments
?
=
nil
)
->
T
?
{
let
x
:
Any
?
=
values
[
key
]
??
defaultValues
[
key
]
??
baseValues
[
key
]
let
x
:
Any
?
=
values
[
key
]
??
defaultValues
[
key
]
??
baseValues
[
key
]
.
flatMap
{
$0
}
if
let
expr
=
x
as?
Expression
{
do
{
expr
.
lookup
=
context
.
views
.
lookupValueOfVariables
...
...
@@ -1131,11 +1131,12 @@ class ActionRunIndexerRun: Action, ActionExec {
self
.
context
.
podAPI
.
runIndexerRun
(
uid
)
{
error
,
data
in
print
(
error
)
error
.
map
{
print
(
$0
)
}
print
(
data
)
}
#warning("@Ruben - I saw this incidentally... this timer needs to be stored in a property somewhere or it won't work as expected")
Timer
.
scheduledTimer
(
withTimeInterval
:
1
,
repeats
:
true
)
{
timer
in
let
timePassed
=
Int
(
Date
()
.
timeIntervalSince
(
start
))
print
(
"polling indexerInstance"
)
...
...
@@ -1216,7 +1217,7 @@ class ActionSetProperty: Action, ActionExec {
throw
"Exception: property is not set to a string"
}
subject
.
set
(
propertyName
,
arguments
[
"value"
]
)
subject
.
set
(
propertyName
,
arguments
[
"value"
]
.
flatMap
{
$0
})
// Flatmap removes the double optional
// TODO: refactor
((
context
as?
SubContext
)?
.
parent
??
context
)
.
scheduleUIUpdate
()
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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