Skip to content
Snippets Groups Projects
Commit 24a7a32d authored by Markus Blatt's avatar Markus Blatt
Browse files

Check whether we already passed the end.

[[Imported from SVN: r1266]]
parent 4de579a6
No related branches found
No related tags found
No related merge requests found
......@@ -413,7 +413,11 @@ namespace Dune
const LocalIterator localEnd = send ? remoteIndices.source_->end() : remoteIndices.target_->end();
CIter oldremote = remote;
while(localIndex!=localEnd && !remote.empty()) {
if(localIndex==localEnd)
//no indices
return;
while(!remote.empty()) {
if( send ? sourceFlags.contains(localIndex->local().attribute()) :
destFlags.contains(localIndex->local().attribute()))
{
......@@ -440,7 +444,10 @@ namespace Dune
}
typename RemoteIndices::GlobalIndex old=localIndex->global();
++localIndex;
if(localIndex==localEnd) // no more indices
break;
if(old==localIndex->global())
// we have the same global index as the previous one
remote=oldremote;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment