Don't add empty NodeRegion, because it will never receive touch events anyway
Summary: Small optimization that prevents empty NodeRegions from being collected. Those will never receive touch events anyway, so why bother allocating memory and iterating over them? Reviewed By: ahmedre Differential Revision: D2816355
This commit is contained in:
parent
584cbd3b99
commit
03637dc70d
|
@ -150,6 +150,11 @@ import com.facebook.react.uimanager.events.EventDispatcher;
|
|||
float top,
|
||||
float right,
|
||||
float bottom) {
|
||||
if (left == right || top == bottom) {
|
||||
// no point in adding an empty NodeRegion
|
||||
return;
|
||||
}
|
||||
|
||||
node.updateNodeRegion(left, top, right, bottom);
|
||||
mNodeRegions.add(node.getNodeRegion());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue