mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-12 16:15:20 +02:00
Clean up Strfnd
Changes: * Fix indentation. * Pass strings by const reference. * Merge Strfnd and WStrfnd into one class instead of copying them. * Remove trailing spaces. * Fix variable names. * Move to util. * Other miscellaneous style fixes.
This commit is contained in:
@@ -23,7 +23,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
#include <sstream>
|
||||
#include "log.h"
|
||||
#include "itemdef.h"
|
||||
#include "strfnd.h"
|
||||
#include "util/strfnd.h"
|
||||
#include "content_mapnode.h" // For loading legacy MaterialItems
|
||||
#include "nameidmapping.h" // For loading legacy MaterialItems
|
||||
#include "util/serialize.h"
|
||||
@@ -218,7 +218,7 @@ void ItemStack::deSerialize(std::istream &is, IItemDefManager *itemdef)
|
||||
Strfnd fnd(all);
|
||||
fnd.next("\"");
|
||||
// If didn't skip to end, we have ""s
|
||||
if(!fnd.atend()){
|
||||
if(!fnd.at_end()){
|
||||
name = fnd.next("\"");
|
||||
} else { // No luck, just read a word then
|
||||
fnd.start(all);
|
||||
@@ -246,7 +246,7 @@ void ItemStack::deSerialize(std::istream &is, IItemDefManager *itemdef)
|
||||
Strfnd fnd(all);
|
||||
fnd.next("\"");
|
||||
// If didn't skip to end, we have ""s
|
||||
if(!fnd.atend()){
|
||||
if(!fnd.at_end()){
|
||||
name = fnd.next("\"");
|
||||
} else { // No luck, just read a word then
|
||||
fnd.start(all);
|
||||
|
Reference in New Issue
Block a user