Revision 92f18b56 trunk/Pithos.Core/Agents/SnapshotDifferencer.cs

b/trunk/Pithos.Core/Agents/SnapshotDifferencer.cs
81 81
                return this;
82 82
            }
83 83

  
84

  
85
            //The previous values that correspond to a NoModification object
86
            //have the same account, container and possibly the same folder
87
            Func<ObjectInfo, ObjectInfo, bool> correspondsTo = (info, noMod) => 
88
                info.Account == noMod.Account
89
                && info.Container == noMod.Container
90
                && (noMod.Name == null || info.Name.StartsWith(noMod.Name));
91

  
84 92
            //Replace any NoModification entries with previous values that have
85 93
            //the same account, container and possibly, folder
86 94
            _current=list.Replace(
87 95
                info => info is NoModificationInfo, 
88
                noMod => from info in _previous
89
                        where 
90
                            info.Account==noMod.Account 
91
                            && info.Container==noMod.Container 
92
                            //If the NoModification specifies a folder, use it to match items below this folder
93
                            && (noMod.Name==null || info.Name.StartsWith(noMod.Name))
94
                        select info);
96
                noMod => _previous.Where(info => correspondsTo(info, noMod)))
97
                .ToList();
95 98

  
96 99
            return this;
97 100
        }

Also available in: Unified diff