| 181 | } |
| 182 | |
| 183 | func (i *initialSyncer) CalculateDelta(remoteState map[string]*FileInformation, localState map[string]*FileInformation) ([]*FileInformation, error) { |
| 184 | strategy := i.o.Strategy |
| 185 | if i.o.Strategy == latest.InitialSyncStrategyMirrorRemote { |
| 186 | strategy = latest.InitialSyncStrategyPreferRemote |
| 187 | } else if i.o.Strategy == latest.InitialSyncStrategyMirrorLocal { |
| 188 | strategy = latest.InitialSyncStrategyPreferLocal |
| 189 | } |
| 190 | |
| 191 | return i.deltaState(remoteState, localState, strategy) |
| 192 | } |
| 193 | |
| 194 | func (i *initialSyncer) deltaState(remoteState map[string]*FileInformation, localState map[string]*FileInformation, strategy latest.InitialSyncStrategy) ([]*FileInformation, error) { |
| 195 | changes := make([]*FileInformation, 0, 1024) |