Commit bbb47d3d45e91192536bed869cc4185e19cc74d0
avoid if statement
Norton Wang committed on 3/6/2018, 3:49:34 AMParent: a9764e4cea10db92064ace79bfa09f6e01704fb4
Files changed
customTypes.js | changed |
customTypes.js | ||
---|---|---|
@@ -192,22 +192,20 @@ | ||
192 | 192 | } |
193 | 193 | |
194 | 194 | const {value: type} = iterator.next() |
195 | 195 | const {value: imports = {entries: []}} = iterator.next() |
196 | - const {value: functions} = iterator.next() | |
197 | - if (functions) { | |
198 | - functions.entries.forEach((typeIndex, funcIndex) => { | |
199 | - let customIndex = mappedFuncs.get(funcIndex) | |
200 | - if (customIndex === undefined) { | |
201 | - customIndex = mappedTypes.get(typeIndex) | |
202 | - } | |
203 | - if (customIndex === undefined) { | |
204 | - customIndex = result.types.push(type.entries[typeIndex]) - 1 | |
205 | - mappedTypes.set(typeIndex, customIndex) | |
206 | - } | |
207 | - result.indexes[funcIndex + imports.entries.length] = customIndex | |
208 | - }) | |
209 | - } | |
196 | + const {value: functions = {entries: []}} = iterator.next() | |
197 | + functions.entries.forEach((typeIndex, funcIndex) => { | |
198 | + let customIndex = mappedFuncs.get(funcIndex) | |
199 | + if (customIndex === undefined) { | |
200 | + customIndex = mappedTypes.get(typeIndex) | |
201 | + } | |
202 | + if (customIndex === undefined) { | |
203 | + customIndex = result.types.push(type.entries[typeIndex]) - 1 | |
204 | + mappedTypes.set(typeIndex, customIndex) | |
205 | + } | |
206 | + result.indexes[funcIndex + imports.entries.length] = customIndex | |
207 | + }) | |
210 | 208 | |
211 | 209 | const {value: exports = {entries: []}} = iterator.next() |
212 | 210 | exports.entries.forEach(entry => { |
213 | 211 | if (entry.kind === 'function') { |
Built with git-ssb-web