Skip to content

Commit

Permalink
[J2KT] Replace usages of !isEmpty() with isNotEmpty().
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 707175525
  • Loading branch information
Googler authored and copybara-github committed Dec 17, 2024
1 parent f139ead commit 7c69815
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class KotlinGeneratorStage(private val output: OutputUtils.Output, private val p
/** Generate ObjC outputs for a compilation unit. */
private fun generateObjCOutputs(compilationUnit: CompilationUnit) {
val source = compilationUnit.j2ObjCCompatHeaderSource
if (!source.isEmpty()) {
if (source.isNotEmpty()) {
val path = compilationUnit.packageRelativePath.replace(".java", "+J2ObjCCompat.h")
output.write(path, source.buildString())
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ class KotlinEnvironment(
// TODO(b/365133427): Annotations are not accounted for hashcode and equals so the logic is
// moved outside of cache. We should move it back once the bug is fixed.
val annotations = irType.annotations
if (!annotations.isEmpty() && annotations.hasAnnotation(FqName("kotlin.UnsafeVariance"))) {
if (annotations.isNotEmpty() && annotations.hasAnnotation(FqName("kotlin.UnsafeVariance"))) {
typeDescriptor = typeDescriptor.toRawTypeDescriptor()
}

Expand Down Expand Up @@ -403,7 +403,7 @@ class KotlinEnvironment(
): DeclaredTypeDescriptor {
// Adjust nullability.
var td = if (irType.isNullable()) toNullable() else toNonNullable()
if (!irType.arguments.isEmpty()) {
if (irType.arguments.isNotEmpty()) {
// Adjust type arguments.
val subsitutionMap =
irType.getTypeSubstitutionMap(useDeclarationVariance).toTypeDescriptorByTypeVariableMap()
Expand Down

0 comments on commit 7c69815

Please sign in to comment.