mirror of
https://github.com/serratus/quaggaJS.git
synced 2026-08-13 05:31:37 +08:00
refactor: move result check to higher level
This commit is contained in:
+3
-3
@@ -164,7 +164,7 @@ function transformResult(result) {
|
|||||||
yOffset = topRight.y,
|
yOffset = topRight.y,
|
||||||
i;
|
i;
|
||||||
|
|
||||||
if (!result || (xOffset === 0 && yOffset === 0)) {
|
if (xOffset === 0 && yOffset === 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -204,7 +204,7 @@ function transformResult(result) {
|
|||||||
function addResult (result, imageData) {
|
function addResult (result, imageData) {
|
||||||
var i;
|
var i;
|
||||||
|
|
||||||
if (!imageData || !result || !_resultCollector) {
|
if (!imageData || !_resultCollector) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -221,7 +221,7 @@ function addResult (result, imageData) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function publishResult(result, imageData) {
|
function publishResult(result, imageData) {
|
||||||
if (_onUIThread) {
|
if (result && _onUIThread) {
|
||||||
transformResult(result);
|
transformResult(result);
|
||||||
addResult(result, imageData);
|
addResult(result, imageData);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user