src/Pure/library.scala
changeset 79842 ba306bc7d226
parent 79839 f425bbc4b2eb
child 79869 ea335307d45e
equal deleted inserted replaced
79841:64a49c55609f 79842:ba306bc7d226
   290   object Update {
   290   object Update {
   291     type Data[A] = Map[String, A]
   291     type Data[A] = Map[String, A]
   292 
   292 
   293     val empty: Update = Update()
   293     val empty: Update = Update()
   294 
   294 
   295     def make[A](data0: Data[A], data1: Data[A], kind: Int = 0): Update =
   295     def make[A](a: Data[A], b: Data[A], kind: Int = 0): Update =
   296       if (data0.eq(data1)) empty
   296       if (a eq b) empty
   297       else {
   297       else {
   298         val delete = List.from(for ((x, y) <- data0.iterator if !data1.get(x).contains(y)) yield x)
   298         val delete = List.from(for ((x, y) <- a.iterator if !b.get(x).contains(y)) yield x)
   299         val insert = List.from(for ((x, y) <- data1.iterator if !data0.get(x).contains(y)) yield x)
   299         val insert = List.from(for ((x, y) <- b.iterator if !a.get(x).contains(y)) yield x)
   300         Update(delete = delete, insert = insert, kind = kind)
   300         Update(delete = delete, insert = insert, kind = kind)
   301       }
   301       }
   302   }
   302   }
   303 
   303 
   304   sealed case class Update(
   304   sealed case class Update(