16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-17 23:39:18 +02:00

Replace starts_with and ends_with with string class methods

This commit is contained in:
docentYT
2026-05-01 17:31:11 +02:00
parent 9c27b54960
commit ec1dfae953
15 changed files with 29 additions and 50 deletions

View File

@@ -566,8 +566,8 @@ state_serializer::deserialize_node( cParser &Input, scene::scratch_data &Scratch
// crude way to detect fixed switch trackbed geometry
|| ( ( true == Global.CreateSwitchTrackbeds )
&& ( Input.Name().size() >= 15 )
&& ( starts_with( Input.Name(), "scenery/zwr" ) )
&& ( ends_with( Input.Name(), ".inc" ) ) ) };
&& Input.Name().starts_with("scenery/zwr")
&& Input.Name().ends_with(".inc") ) };
if( false == skip ) {
@@ -749,7 +749,7 @@ state_serializer::deserialize_terrain(cParser &Input, scene::scratch_data &Scrat
std::string line;
Input.getTokens(1);
Input >> line;
if ((true == Global.file_binary_terrain) && (true == ends_with(line, ".sbt")))
if (Global.file_binary_terrain && line.ends_with(".sbt"))
{
Scratchpad.binary.terrain = Region->is_scene(line);
Global.file_binary_terrain_state = true;