Skip to content

Commit c7cd1f3

Browse files
committed
categorical 2dMap: remove hasOwnProperty() call
1 parent 0c41776 commit c7cd1f3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/traces/heatmap/clean_2d_array.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,10 @@ module.exports = function clean2dArray(zOld, trace, xa, ya) {
4646
for(i = 0; i < traceCategories.length; i++) {
4747
axMapping[traceCategories[i]] = i;
4848
}
49-
return function(i) {return axMapping.hasOwnProperty(ax._categories[i]) ? axMapping[ax._categories[i]] : BADNUM;};
49+
return function(i) {
50+
var ind = axMapping[ax._categories[i]];
51+
return ind + 1 ? ind : BADNUM;
52+
};
5053
} else {
5154
return Lib.identity;
5255
}

0 commit comments

Comments
 (0)