Revision 99e6329f trunk/Pithos.Core/Agents/SnapshotDifferencer.cs

b/trunk/Pithos.Core/Agents/SnapshotDifferencer.cs
75 75
        public SnapshotDifferencer Post(IEnumerable<ObjectInfo> list)
76 76
        {
77 77
            _previous = _current;
78
            _current = list ?? new List<ObjectInfo>();
78
            if (list == null)
79
            {
80
                _current = new List<ObjectInfo>();
81
                return this;
82
            }
83

  
84
            //Replace any NoModification entries with previous values that have
85
            //the same account, container and possibly, folder
86
            _current=list.Replace(
87
                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);
95

  
79 96
            return this;
80 97
        }
81 98
        

Also available in: Unified diff