From c06f17344486ea4397b86e239760295113a0eec8 Mon Sep 17 00:00:00 2001 From: levlam Date: Mon, 17 Jun 2019 02:55:27 +0300 Subject: [PATCH] Speed up WebPageBlock constructors. GitOrigin-RevId: 9a02631f7b1cdb7789bad9ab3b3a306f58498e12 --- td/telegram/WebPageBlock.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/td/telegram/WebPageBlock.cpp b/td/telegram/WebPageBlock.cpp index b41e76604..54dcdb02d 100644 --- a/td/telegram/WebPageBlock.cpp +++ b/td/telegram/WebPageBlock.cpp @@ -623,7 +623,7 @@ class WebPageBlockPreformatted : public WebPageBlock { public: WebPageBlockPreformatted() = default; - WebPageBlockPreformatted(RichText &&text, string language) : text(std::move(text)), language(std::move(language)) { + WebPageBlockPreformatted(RichText &&text, string &&language) : text(std::move(text)), language(std::move(language)) { } Type get_type() const override { @@ -713,7 +713,7 @@ class WebPageBlockAnchor : public WebPageBlock { public: WebPageBlockAnchor() = default; - explicit WebPageBlockAnchor(string name) : name(std::move(name)) { + explicit WebPageBlockAnchor(string &&name) : name(std::move(name)) { } Type get_type() const override { @@ -985,7 +985,7 @@ class WebPageBlockPhoto : public WebPageBlock { public: WebPageBlockPhoto() = default; - WebPageBlockPhoto(Photo photo, WebPageBlockCaption &&caption, string &&url, WebPageId web_page_id) + WebPageBlockPhoto(Photo &&photo, WebPageBlockCaption &&caption, string &&url, WebPageId web_page_id) : photo(std::move(photo)), caption(std::move(caption)), url(std::move(url)), web_page_id(web_page_id) { } @@ -1147,7 +1147,7 @@ class WebPageBlockEmbedded : public WebPageBlock { public: WebPageBlockEmbedded() = default; - WebPageBlockEmbedded(string url, string html, Photo poster_photo, Dimensions dimensions, + WebPageBlockEmbedded(string &&url, string &&html, Photo &&poster_photo, Dimensions dimensions, WebPageBlockCaption &&caption, bool is_full_width, bool allow_scrolling) : url(std::move(url)) , html(std::move(html)) @@ -1214,7 +1214,7 @@ class WebPageBlockEmbeddedPost : public WebPageBlock { public: WebPageBlockEmbeddedPost() = default; - WebPageBlockEmbeddedPost(string url, string author, Photo author_photo, int32 date, + WebPageBlockEmbeddedPost(string &&url, string &&author, Photo &&author_photo, int32 date, vector> &&page_blocks, WebPageBlockCaption &&caption) : url(std::move(url)) , author(std::move(author)) @@ -1354,7 +1354,7 @@ class WebPageBlockChatLink : public WebPageBlock { public: WebPageBlockChatLink() = default; - WebPageBlockChatLink(string title, DialogPhoto photo, string username) + WebPageBlockChatLink(string &&title, DialogPhoto photo, string &&username) : title(std::move(title)), photo(std::move(photo)), username(std::move(username)) { }