mirror of
https://github.com/HighCapable/YukiReflection.git
synced 2025-09-07 03:05:21 +08:00
Modify change some HashMap to ArrayMap to save memory
This commit is contained in:
@@ -31,6 +31,7 @@
|
|||||||
|
|
||||||
package com.highcapable.yukireflection.finder.base.rules
|
package com.highcapable.yukireflection.finder.base.rules
|
||||||
|
|
||||||
|
import android.util.ArrayMap
|
||||||
import java.lang.reflect.Field
|
import java.lang.reflect.Field
|
||||||
import java.lang.reflect.Member
|
import java.lang.reflect.Member
|
||||||
import java.lang.reflect.Method
|
import java.lang.reflect.Method
|
||||||
@@ -48,7 +49,7 @@ class ModifierRules private constructor(private val instance: Any) {
|
|||||||
internal companion object {
|
internal companion object {
|
||||||
|
|
||||||
/** 当前实例数组 */
|
/** 当前实例数组 */
|
||||||
private val instances = HashMap<Long, ModifierRules>()
|
private val instances = ArrayMap<Long, ModifierRules>()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取模板字符串数组
|
* 获取模板字符串数组
|
||||||
|
@@ -28,6 +28,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.highcapable.yukireflection.finder.store
|
package com.highcapable.yukireflection.finder.store
|
||||||
|
|
||||||
|
import android.util.ArrayMap
|
||||||
import com.highcapable.yukireflection.YukiReflection
|
import com.highcapable.yukireflection.YukiReflection
|
||||||
import java.lang.reflect.Constructor
|
import java.lang.reflect.Constructor
|
||||||
import java.lang.reflect.Field
|
import java.lang.reflect.Field
|
||||||
@@ -46,22 +47,22 @@ import java.lang.reflect.Method
|
|||||||
internal object ReflectsCacheStore {
|
internal object ReflectsCacheStore {
|
||||||
|
|
||||||
/** 缓存的 [Class] 列表 */
|
/** 缓存的 [Class] 列表 */
|
||||||
private val dexClassListData = HashMap<Int, List<String>>()
|
private val dexClassListData = ArrayMap<Int, List<String>>()
|
||||||
|
|
||||||
/** 缓存的 [Class] 对象 */
|
/** 缓存的 [Class] 对象 */
|
||||||
private val classData = HashMap<Int, Class<*>?>()
|
private val classData = ArrayMap<Int, Class<*>?>()
|
||||||
|
|
||||||
/** 缓存的 [Class] 数组 */
|
/** 缓存的 [Class] 数组 */
|
||||||
private val classesData = HashMap<Int, HashSet<Class<*>>>()
|
private val classesData = ArrayMap<Int, HashSet<Class<*>>>()
|
||||||
|
|
||||||
/** 缓存的 [Method] 数组 */
|
/** 缓存的 [Method] 数组 */
|
||||||
private val methodsData = HashMap<Int, HashSet<Method>>()
|
private val methodsData = ArrayMap<Int, HashSet<Method>>()
|
||||||
|
|
||||||
/** 缓存的 [Constructor] 数组 */
|
/** 缓存的 [Constructor] 数组 */
|
||||||
private val constructorsData = HashMap<Int, HashSet<Constructor<*>>>()
|
private val constructorsData = ArrayMap<Int, HashSet<Constructor<*>>>()
|
||||||
|
|
||||||
/** 缓存的 [Field] 数组 */
|
/** 缓存的 [Field] 数组 */
|
||||||
private val fieldsData = HashMap<Int, HashSet<Field>>()
|
private val fieldsData = ArrayMap<Int, HashSet<Field>>()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查找缓存中的 [Class] 列表
|
* 查找缓存中的 [Class] 列表
|
||||||
|
Reference in New Issue
Block a user