Skip to content

Commit

Permalink
[perf] set ptr = nullptr as default
Browse files Browse the repository at this point in the history
  • Loading branch information
jun01.feng committed Aug 31, 2024
1 parent 4aa50a9 commit b1411d7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/UtilsCtrl/UAllocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class UAllocator : public CObject {
template<typename T, typename ...Args,
c_enable_if_t<std::is_base_of<CObject, T>::value, int> = 0>
static T* safeMallocTemplateCObject(Args&&... args) {
T* result{};
T* result = nullptr;
while (!result) {
result = new(std::nothrow) T(std::forward<Args&&>(args)...);
}
Expand Down

0 comments on commit b1411d7

Please sign in to comment.