[DiscordArchive] so.... mb delete the has_items variable since it's unused otherwise?
[DiscordArchive] so.... mb delete the has_items variable since it's unused otherwise?
Archived author: MishaParem • Posted: 2020-05-11T20:16:08.320000+00:00
Original source
according to the commits that <@!224931509046345729> found, using has_item in the if statement causes a bug where not all items are recieved
Archived author: MishaParem • Posted: 2020-05-11T20:16:51.785000+00:00
Original source
however, if we don't use it in the if statement, then I get a compiler warning
Archived author: MishaParem • Posted: 2020-05-11T20:18:08.015000+00:00
Original source
in the context of that function, has_item is not used anywhere else, so the solution I propose is either:
- remove the has_item bool altogether
- add has_item to the Mail struct
Archived author: MishaParem • Posted: 2020-05-11T20:18:20.296000+00:00
Original source
your thoughts, <@!108617457836539904> ?
Archived author: Yehonal • Posted: 2020-05-11T20:25:18.732000+00:00
Original source
well, the most elegant solution would be to use a proper Entity class for those fields instead of using them directly into the if condition.
However, it requires more work, you can safely delete the has_items
Archived author: MishaParem • Posted: 2020-05-11T20:26:07.012000+00:00
Original source
as in, create a mail entiity class?
Archived author: Yehonal • Posted: 2020-05-11T20:26:53.300000+00:00
Original source
let me check 1 sec
Archived author: Yehonal • Posted: 2020-05-11T20:38:41.104000+00:00
Original source
nope, it's useless to store that value within the Mail structure. the has_item can be easily removed since it's just used in that condition statement to fill the items list
Archived author: Yehonal • Posted: 2020-05-11T20:39:31.641000+00:00
Original source
then the struct has an internal hasItem method:
``` bool HasItems() const { return !items.empty(); }```
Archived author: MishaParem • Posted: 2020-05-11T20:41:58.798000+00:00
Original source
ok. removed has_item. not sure when I'll get to the PR for it, mb tomorrow. I've been chewing on warnings all day, and I'm still compiling only to 30%. mb I'm doing it wrong, mb I should compile w/o -Werrors and read all the errors post factum