From 70a880a89c0fe0506c99ab2ac13e393bab58d876 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 12 Jan 2017 11:56:30 +0100 Subject: [PATCH] no need to test the length --- src/solidity/decodeInfo.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/solidity/decodeInfo.js b/src/solidity/decodeInfo.js index e5682491f7..e2c4239d07 100644 --- a/src/solidity/decodeInfo.js +++ b/src/solidity/decodeInfo.js @@ -119,7 +119,7 @@ function stringType (type) { function array (type, stateDefinitions, contractName) { var arraySize var match = type.match(/(.*)\[(.*?)\]( storage ref| storage pointer| memory| calldata)?$/) - if (!match || match.length < 3) { + if (!match) { console.log('unable to parse type ' + type) return null } @@ -161,7 +161,7 @@ function enumType (type, stateDefinitions, contractName) { */ function struct (type, stateDefinitions, contractName) { var match = type.match(/struct (\S*?)( storage ref| storage pointer| memory| calldata)?$/) - if (match && match.length > 2) { + if (match) { var memberDetails = getStructMembers(match[1], stateDefinitions, contractName) // type is used to extract the ast struct definition if (!memberDetails) return null return new StructType(memberDetails, match[2].trim())