Small optimizations in DRC and SHAPE_POLY_SET.

This commit is contained in:
Alex 2022-11-17 02:09:46 +05:00
parent 3dea146488
commit 5e7c4b734c
3 changed files with 5 additions and 3 deletions

View File

@ -2,7 +2,7 @@
* This file is part of libeval, a simple math expression evaluator
*
* Copyright (C) 2017 Michael Geselbracht, mgeselbracht3@gmail.com
* Copyright (C) 2019-2021 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2019-2022 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -124,7 +124,7 @@ bool VALUE::EqualTo( CONTEXT* aCtx, const VALUE* b ) const
if( b->m_stringIsWildcard )
return WildCompareString( b->AsString(), AsString(), false );
else
return !AsString().CmpNoCase( b->AsString() );
return AsString().IsSameAs( b->AsString(), false );
}
return false;

View File

@ -95,6 +95,8 @@ SHAPE_POLY_SET::SHAPE_POLY_SET( const SHAPE_POLY_SET& aOther ) :
{
if( aOther.IsTriangulationUpToDate() )
{
m_triangulatedPolys.reserve( aOther.TriangulatedPolyCount() );
for( unsigned i = 0; i < aOther.TriangulatedPolyCount(); i++ )
{
const TRIANGULATED_POLYGON* poly = aOther.TriangulatedPolygon( i );

View File

@ -1720,7 +1720,7 @@ int DRC_ENGINE::MatchDpSuffix( const wxString& aNetName, wxString& aComplementNe
if( rv != 0 && count >= 1 )
{
aBaseDpName = aNetName.Left( aNetName.Length() - count );
aComplementNet = aBaseDpName + aComplementNet + aNetName.Right( count - 1 );
aComplementNet = wxString( aBaseDpName ) << aComplementNet << aNetName.Right( count - 1 );
}
return rv;