Loading descriptors from incremental cache instead of package classes.
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
package org.jetbrains.jet.utils.addToStdlib
|
||||
|
||||
import java.util.HashMap
|
||||
import java.util.Collections
|
||||
|
||||
fun <K, V> Map<K, V>.filterKeys(predicate: (K)->Boolean): Map<K, V> {
|
||||
val result = HashMap<K, V>()
|
||||
@@ -27,3 +28,7 @@ fun <K, V> Map<K, V>.filterKeys(predicate: (K)->Boolean): Map<K, V> {
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
fun <T: Any> T?.singletonOrEmptyList(): List<T> = if (this != null) Collections.singletonList(this) else Collections.emptyList()
|
||||
|
||||
fun <T: Any> T?.singletonOrEmptySet(): Set<T> = if (this != null) Collections.singleton(this) else Collections.emptySet()
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Copyright 2010-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.jet.utils.intellij
|
||||
|
||||
import com.intellij.openapi.util.Pair
|
||||
|
||||
public fun <A> Pair<A, *>.component1(): A = getFirst()
|
||||
|
||||
public fun <B> Pair<*, B>.component2(): B = getSecond()
|
||||
Reference in New Issue
Block a user