Skip to content

Commit

Permalink
Reduce code lines
Browse files Browse the repository at this point in the history
  • Loading branch information
hans00 committed Sep 28, 2023
1 parent 43b0a37 commit 6a99797
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 2 additions & 4 deletions package/cpp/api/JsiSkCanvas.h
Original file line number Diff line number Diff line change
Expand Up @@ -507,10 +507,8 @@ class JsiSkCanvas : public JsiSkHostObject {
} else {
bytesPerRow = info->minRowBytes();
}
auto dest =
count > 3
? RNSkTypedArray::getTypedArray(runtime, arguments[3], *info)
: RNSkTypedArray::getTypedArray(runtime, jsi::Value::null(), *info);
auto dest = RNSkTypedArray::getTypedArray(
runtime, count > 3 ? arguments[3] : jsi::Value::null(), *info);
if (!dest.isObject()) {
return jsi::Value::null();
}
Expand Down
6 changes: 2 additions & 4 deletions package/cpp/api/JsiSkImage.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,8 @@ class JsiSkImage : public JsiSkWrappingSkPtrHostObject<SkImage> {
} else {
bytesPerRow = info.minRowBytes();
}
auto dest =
count > 3
? RNSkTypedArray::getTypedArray(runtime, arguments[3], info)
: RNSkTypedArray::getTypedArray(runtime, jsi::Value::null(), info);
auto dest = RNSkTypedArray::getTypedArray(
runtime, count > 3 ? arguments[3] : jsi::Value::null(), info);
if (!dest.isObject()) {
return jsi::Value::null();
}
Expand Down

0 comments on commit 6a99797

Please sign in to comment.