git ssb

0+

wanderer🌟 / js-primea-hypervisor



Commit bbb47d3d45e91192536bed869cc4185e19cc74d0

avoid if statement

Norton Wang committed on 3/6/2018, 3:49:34 AM
Parent: a9764e4cea10db92064ace79bfa09f6e01704fb4

Files changed

customTypes.jschanged
customTypes.jsView
@@ -192,22 +192,20 @@
192192 }
193193
194194 const {value: type} = iterator.next()
195195 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+ })
210208
211209 const {value: exports = {entries: []}} = iterator.next()
212210 exports.entries.forEach(entry => {
213211 if (entry.kind === 'function') {

Built with git-ssb-web