Skip to content

Commit f69b51d

Browse files
JohnCoconuthuangwei1024
authored andcommitted
prefer delegate constructor over new(this) (cocos2d#19613)
1 parent 8c816b6 commit f69b51d

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

cocos/network/CCDownloader.cpp

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57,16 +57,7 @@ namespace cocos2d { namespace network {
5757

5858
////////////////////////////////////////////////////////////////////////////////
5959
// Implement Downloader
60-
Downloader::Downloader()
61-
{
62-
DownloaderHints hints =
63-
{
64-
6,
65-
45,
66-
".tmp"
67-
};
68-
new(this)Downloader(hints);
69-
}
60+
Downloader::Downloader() : Downloader(DownloaderHints{6, 45, ".tmp"}) { }
7061

7162
Downloader::Downloader(const DownloaderHints& hints)
7263
{

0 commit comments

Comments
 (0)