Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Saver double comparison, minor code cleanup (deleting a 0 pointer is …
…always save)
  • Loading branch information
mhugent committed Jan 4, 2013
1 parent 6a936b9 commit 3359870
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions src/core/symbology-ng/qgsfillsymbollayerv2.cpp
Expand Up @@ -385,10 +385,7 @@ void QgsSVGFillSymbolLayer::startRender( QgsSymbolV2RenderContext& context )
return;
}

if ( mSvgPattern )
{
delete mSvgPattern;
}
delete mSvgPattern;
mSvgPattern = 0;
double size = context.outputPixelSize( mPatternWidth );

Expand Down
2 changes: 1 addition & 1 deletion src/core/symbology-ng/qgssvgcache.cpp
Expand Up @@ -445,7 +445,7 @@ QgsSvgCacheEntry* QgsSvgCache::cacheEntry( const QString& file, double size, con
for ( ; entryIt != entries.end(); ++entryIt )
{
QgsSvgCacheEntry* cacheEntry = *entryIt;
if ( cacheEntry->file == file && cacheEntry->size == size && cacheEntry->fill == fill && cacheEntry->outline == outline &&
if ( cacheEntry->file == file && doubleNear( cacheEntry->size, size ) && cacheEntry->fill == fill && cacheEntry->outline == outline &&
cacheEntry->outlineWidth == outlineWidth && cacheEntry->widthScaleFactor == widthScaleFactor && cacheEntry->rasterScaleFactor == rasterScaleFactor )
{
currentEntry = cacheEntry;
Expand Down

0 comments on commit 3359870

Please sign in to comment.