yourWaifu / sleepy-discord

C++ library for the Discord chat client. Please use Rust for new bots
https://yourWaifu.github.io/sleepy-discord/
MIT License
708 stars 93 forks source link

Const reference instead of copying? #237

Closed fleshka4 closed 3 years ago

fleshka4 commented 3 years ago

Why we have to copy each of these positions? We are using C++ to have a better performance. Let's replace it with const references https://github.com/yourWaifu/sleepy-discord/blob/0f090ffc883dd7f0212969c5bed9c2b1699b2a38/include/sleepy_discord/client.h#L568

yourWaifu commented 3 years ago

Have you tested if it makes a difference? And besides, in most cases, it's meant to move the objects. I think it's better, I start use std::move to make that more clear.