Skip to content

Commit

Permalink
refactor: remove unnecessary code
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgerardojacinto committed Nov 10, 2023
1 parent a6a59fe commit 2d598bb
Showing 1 changed file with 4 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,35 +22,11 @@ class OSBARCScanLibraryFactory {
zxingHelper: OSBARCZXingHelperInterface,
mlkitHelper: OSBARCMLKitHelperInterface
): OSBARCScanLibraryInterface {
return when (scanLibrary) {
LIBRARY_ZXING -> {
createZXingWrapper(zxingHelper)
}

LIBRARY_MLKIT -> {
createMLKitWrapper(mlkitHelper)
}

else -> {
createZXingWrapper(zxingHelper)
}
return if (scanLibrary == LIBRARY_MLKIT) {
OSBARCMLKitWrapper(mlkitHelper)
} else {
OSBARCZXingWrapper(zxingHelper)
}
}

/**
* Creates and returns a OSBARCZXingWrapper instance.
* @return the newly created OSBARCZXingWrapper instance.
*/
private fun createZXingWrapper(helper: OSBARCZXingHelperInterface): OSBARCZXingWrapper {
return OSBARCZXingWrapper(helper)
}

/**
* Creates and returns a OSBARCMLKitWrapper instance.
* @return the newly created OSBARCMLKitWrapper instance.
*/
private fun createMLKitWrapper(helper: OSBARCMLKitHelperInterface): OSBARCMLKitWrapper {
return OSBARCMLKitWrapper(helper)
}
}
}

0 comments on commit 2d598bb

Please sign in to comment.