From 66d31b14c9d9446327db139e5bd7ac75a9a7b87c Mon Sep 17 00:00:00 2001 From: liuqingcan Date: Mon, 28 Jan 2019 16:55:34 +0800 Subject: [PATCH] resolve PMOpDesc&ProgramOptimize warning --- metal/paddle-mobile/paddle-mobile/Src/Program/PMOpDesc.swift | 2 +- .../paddle-mobile/Src/Program/ProgramOptimize.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/metal/paddle-mobile/paddle-mobile/Src/Program/PMOpDesc.swift b/metal/paddle-mobile/paddle-mobile/Src/Program/PMOpDesc.swift index bc9a1abebd..663677150e 100644 --- a/metal/paddle-mobile/paddle-mobile/Src/Program/PMOpDesc.swift +++ b/metal/paddle-mobile/paddle-mobile/Src/Program/PMOpDesc.swift @@ -27,7 +27,7 @@ class PMOpDesc { var map: [String : [String]] = [:] for opDescVar in vars { if (canAdd(opDescVar.parameter)) { - map[opDescVar.parameter] = opDescVar.argumentsArray as! [String] + map[opDescVar.parameter] = opDescVar.argumentsArray as? [String] } } return map diff --git a/metal/paddle-mobile/paddle-mobile/Src/Program/ProgramOptimize.swift b/metal/paddle-mobile/paddle-mobile/Src/Program/ProgramOptimize.swift index 0c41ca3f9d..dcb065de3d 100644 --- a/metal/paddle-mobile/paddle-mobile/Src/Program/ProgramOptimize.swift +++ b/metal/paddle-mobile/paddle-mobile/Src/Program/ProgramOptimize.swift @@ -292,7 +292,7 @@ class ProgramOptimize { ops.append(node.opDesc!) } - var newProgramDesc = PMProgramDesc.init() + let newProgramDesc = PMProgramDesc.init() let newBlock = PMBlockDesc.init(inVars: block.vars, inOps: ops) newProgramDesc.blocks.append(newBlock) return newProgramDesc -- GitLab