blob: 8563d02a6550017dd16e8f92a74ca07c8f92fff2 [file] [log] [blame]
// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
extension ListExtension<E> on List<E> {
void addIfNotNull(E? element) {
if (element != null) {
add(element);
}
}
}
extension SetExtension<E> on Set<E> {
void addIfNotNull(E? element) {
if (element != null) {
add(element);
}
}
}