[GRASS-SVN] r63163 - grass/branches/develbranch_6/lib/vector/dglib
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Nov 26 10:51:55 PST 2014
Author: mmetz
Date: 2014-11-26 10:51:55 -0800 (Wed, 26 Nov 2014)
New Revision: 63163
Modified:
grass/branches/develbranch_6/lib/vector/dglib/sp-template.c
Log:
dglib: fix sp cache initialization (backport r63161)
Modified: grass/branches/develbranch_6/lib/vector/dglib/sp-template.c
===================================================================
--- grass/branches/develbranch_6/lib/vector/dglib/sp-template.c 2014-11-26 18:51:33 UTC (rev 63162)
+++ grass/branches/develbranch_6/lib/vector/dglib/sp-template.c 2014-11-26 18:51:55 UTC (rev 63163)
@@ -256,8 +256,18 @@
clipInput.nFromDistance = 0; \
if ( fnClip( pgraph , & clipInput , & clipOutput , pvClipArg ) ) continue; \
} \
- pPredistItem = dglTreePredistAdd( pCache->pvPredist, DGL_NODE_ID(pDestination) ); \
- if ( pPredistItem == NULL ) goto sp_error; \
+ findPredist.nKey = DGL_NODE_ID(pDestination); \
+ if ( (pPredistItem = avl_find( pCache->pvPredist, &findPredist)) == NULL ) { \
+ if ( (pPredistItem = dglTreePredistAdd( pCache->pvPredist, DGL_NODE_ID(pDestination) )) == NULL ) { \
+ pgraph->iErrno = DGL_ERR_MemoryExhausted; \
+ goto sp_error; \
+ } \
+ } \
+ else { \
+ if ( pPredistItem->nDistance <= clipOutput.nEdgeCost ) { \
+ continue; \
+ } \
+ } \
pPredistItem->nFrom = nStart; \
pPredistItem->pnEdge = pEdge; \
pPredistItem->nCost = clipOutput.nEdgeCost; \
More information about the grass-commit
mailing list