@@ -758,10 +758,8 @@ bool player::save(dpp::snowflake user_id, bool put_backup)
758
758
db::paramlist p;
759
759
for (const stacked_item& possession : possessions) {
760
760
if (possession.name != " [none]" ) {
761
- p.emplace_back (user_id);
762
- p.emplace_back (possession.name );
763
- p.emplace_back (possession.flags );
764
- p.emplace_back (possession.qty );
761
+ db::paramlist item{user_id, possession.name , possession.flags , possession.qty };
762
+ p.insert (std::end (p), std::begin (item), std::end (item));
765
763
query += " (?,?,?,?)," ;
766
764
}
767
765
}
@@ -773,10 +771,8 @@ bool player::save(dpp::snowflake user_id, bool put_backup)
773
771
query = " INSERT INTO game_owned_items (user_id, item_desc, item_flags, qty) VALUES" ;
774
772
for (const item& herb : herbs) {
775
773
if (herb.name != " [none]" ) {
776
- p.emplace_back (user_id);
777
- p.emplace_back (herb.name );
778
- p.emplace_back (herb.flags );
779
- p.emplace_back (1 );
774
+ db::paramlist item{user_id, herb.name , herb.flags , 1 };
775
+ p.insert (std::end (p), std::begin (item), std::end (item));
780
776
query += " (?,?,?,?)," ;
781
777
}
782
778
}
@@ -788,10 +784,8 @@ bool player::save(dpp::snowflake user_id, bool put_backup)
788
784
query = " INSERT INTO game_owned_items (user_id, item_desc, item_flags, qty) VALUES" ;
789
785
for (const item& spell : spells) {
790
786
if (spell.name != " [none]" ) {
791
- p.emplace_back (user_id);
792
- p.emplace_back (spell.name );
793
- p.emplace_back (spell.flags );
794
- p.emplace_back (1 );
787
+ db::paramlist item{user_id, spell.name , spell.flags , 1 };
788
+ p.insert (std::end (p), std::begin (item), std::end (item));
795
789
query += " (?,?,?,?)," ;
796
790
}
797
791
}
0 commit comments