From 901685f01bd211afdf64d1d6d984c9f2a0a05e25 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Thu, 3 Feb 2022 10:34:14 -0800 Subject: [PATCH] Don't convert KIID on the fly Converting to string on save prevent unneeded ops --- pcbnew/router/pns_logger.cpp | 6 +++--- pcbnew/router/pns_logger.h | 3 ++- pcbnew/router/router_tool.cpp | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/pcbnew/router/pns_logger.cpp b/pcbnew/router/pns_logger.cpp index fb02d599c4..13b0b8d399 100644 --- a/pcbnew/router/pns_logger.cpp +++ b/pcbnew/router/pns_logger.cpp @@ -54,7 +54,7 @@ void LOGGER::Save( const std::string& aFilename ) uint64_t id = 0; fprintf( f, "event %d %d %d %s\n", evt.type, evt.p.x, evt.p.y, - (const char*) evt.uuid.c_str() ); + static_cast( evt.uuid.AsString().c_str() ) ); } fclose( f ); @@ -67,11 +67,11 @@ void LOGGER::Log( LOGGER::EVENT_TYPE evt, const VECTOR2I& pos, const ITEM* item ent.type = evt; ent.p = pos; - ent.uuid = "null"; + ent.uuid = KIID(0); if( item && item->Parent() ) - ent.uuid = item->Parent()->m_Uuid.AsString(); + ent.uuid = item->Parent()->m_Uuid; m_events.push_back( ent ); } diff --git a/pcbnew/router/pns_logger.h b/pcbnew/router/pns_logger.h index d607021611..04145d282f 100644 --- a/pcbnew/router/pns_logger.h +++ b/pcbnew/router/pns_logger.h @@ -28,6 +28,7 @@ #include #include +#include class SHAPE_LINE_CHAIN; class SHAPE; @@ -51,7 +52,7 @@ public: struct EVENT_ENTRY { VECTOR2I p; EVENT_TYPE type; - wxString uuid; + KIID uuid; }; LOGGER(); diff --git a/pcbnew/router/router_tool.cpp b/pcbnew/router/router_tool.cpp index e86ee4c4ba..b437d51375 100644 --- a/pcbnew/router/router_tool.cpp +++ b/pcbnew/router/router_tool.cpp @@ -540,7 +540,7 @@ void ROUTER_TOOL::saveRouterDebugLog() for( auto evt : events) { fprintf( f, "event %d %d %d %s\n", evt.p.x, evt.p.y, evt.type, - (const char*) evt.uuid.c_str() ); + static_cast( evt.uuid.AsString().c_str() ) ); } fclose( f );