All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.autonomousapps.internal.utils.procs.kt Maven / Gradle / Ivy

There is a newer version: 2.0.2
Show newest version
package com.autonomousapps.internal.utils

import com.autonomousapps.internal.AnnotationProcessor

/**
 * Because there is a 1-to-many relationship between dependencies and annotation processors (one dependency can
 * declare many annotation processors; see AutoValue for example), our set difference needs to consider _only_
 * the dependency itself.
 */
internal operator fun Set.minus(other: Set): Set {
  // Initialize with full set
  val difference = mutableSetOf().apply { addAll(this@minus) }
  // Now remove from set all matches in `other`
  for (proc in this) {
    if (other.any { it.dependency == proc.dependency }) {
      difference.remove(proc)
    }
  }
  return difference
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy