Skip to content

Commit

Permalink
prefer delegate constructor over new(this) (#19613)
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnCoconut authored and minggo committed Apr 19, 2019
1 parent 494bf3e commit 5ca2cd7
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions cocos/network/CCDownloader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,7 @@ namespace cocos2d { namespace network {

////////////////////////////////////////////////////////////////////////////////
// Implement Downloader
Downloader::Downloader()
{
DownloaderHints hints =
{
6,
45,
".tmp"
};
new(this)Downloader(hints);
}
Downloader::Downloader() : Downloader(DownloaderHints{6, 45, ".tmp"}) { }

Downloader::Downloader(const DownloaderHints& hints)
{
Expand Down

0 comments on commit 5ca2cd7

Please sign in to comment.