The following commit has been merged in the master branch:
commit bec8388dca42ddc20c8c0580349f2560026c11a0
Author: Andrei Zavada <[email protected]>
Date:   Fri Apr 26 01:48:59 2013 +0300

    compare not pointers but what they point to, to uniquify common_annotations

diff --git a/src/ui/sf/sf.cc b/src/ui/sf/sf.cc
index b669686..8cfbb63 100644
--- a/src/ui/sf/sf.cc
+++ b/src/ui/sf/sf.cc
@@ -141,12 +141,14 @@ SScoringFacility (agh::CSubject& J,
       // collect common annotations
        for ( auto& H : channels )
                for ( auto& A : H.crecording.F().annotations() )
-                       common_annotations.push_back( {&H.crecording.F(), &A}); 
// bitch&
+                       if ( not any_of( common_annotations.begin(), 
common_annotations.end(),
+                                        [&A]( const pair<const 
sigfile::CSource*, const sigfile::SAnnotation*>& a1)
+                                        { return *a1.second == A; }) )
+                               common_annotations.push_back( 
{&H.crecording.F(), &A}); // bitch&
        common_annotations.sort(
              []( const pair<const sigfile::CSource*, const 
sigfile::SAnnotation*>& a1,
                  const pair<const sigfile::CSource*, const 
sigfile::SAnnotation*>& a2)
              { return *a1.second < *a2.second; });
-       common_annotations.unique();
        printf( "collected %zu embedded annotations\n", 
common_annotations.size());
 
       // count n_eeg_channels

-- 
Sleep experiment manager

_______________________________________________
debian-med-commit mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/debian-med-commit

Reply via email to