对组可管理意为<br>
1 建立下级组
2 移动下级组顺序
不能改变组的1）权限和2）直接成员，3）删除组，4）重命名，这些将看作组同部分一起看待的。
只要拥有上级组的管理权限，才能变更这些，这些称之为写权限。
成员关系可以等价于读权限
授权关系可以等价于读权限传播
拥有某组的管理权限，不意味拥有下级组的管理权限。新建组情况自动授予该组的其他管理者管理权限。
438387
public String edit() {
    Role role = (Role) getEntity();
    User me = userService.get(SecurityUtils.getUsername());
    if (role.isPersisted()) {
      if (!roleService.isAdmin(me, role)) {
        if (null != role.getParent())
          return redirect("search", "不能修改该组,你没有" + role.getParent().getName() + "的管理权限");
        else return redirect("search", "不能修改该组,你没有Root的管理权限");
      }
    }
    put("role", role);
    OqlBuilder<Role> query = OqlBuilder.from(getEntityName(), "role");
    if (!isAdmin()) {
      query.join("role.members", "gm");
      query.where("gm.user=:me and gm.manager=true", me);
    }
    List<Role> parents = entityDao.search(query);
    parents.removeAll(HierarchyEntityUtils.getFamily(role));
    put("parents", parents);
    return forward();
  }
867131
public void train() throws Exception {

			//建立字典管理器

			
			Pipe lpipe = new Target2Label(al);
			Pipe fpipe = new StringArray2IndexArray(factory, true);
			//构造转换器组
			SeriesPipes pipe = new SeriesPipes(new Pipe[]{lpipe,fpipe});



			InstanceSet instset = new InstanceSet(pipe,factory);
			instset.loadThruStagePipes(new SimpleFileReader(trainFile," ",true,Type.LabelData)); 
			Generator gen = new SFGenerator();
			ZeroOneLoss l = new ZeroOneLoss();
			Inferencer ms = new LinearMax(gen, factory.getLabelSize());
			Update update = new LinearMaxPAUpdate(l);
			OnlineTrainer trainer = new OnlineTrainer(ms, update,l, factory, 50,0.005f);
			Linear pclassifier = trainer.train(instset,instset);
			pipe.removeTargetPipe();
			pclassifier.setPipe(pipe);
			factory.setStopIncrement(true);
			pclassifier.saveTo(modelFile);
		}
1092383
function init(element, callback, extraOptions /* Internal Use Only */ ) {
            // 初始化任务队列
            // var queue = Util.queue() // #20

            // 如果已经被初始化，则立即返回
            var clientId = element.clientId
            if (clientId !== undefined) {
                if (callback) callback(undefined, CACHE[clientId])
                return
            }

            // 如果没有模块标识符，则不需要初始化
            if (!element.getAttribute(Constant.ATTRS.id)) {
                if (callback) callback(undefined, undefined)
                return
            }

            // 1. 解析配置项
            var options = Options.parse(element)
            if (extraOptions) Util.extend(options, extraOptions)

            var BrixImpl, instance

            var label = 'module ' + options.moduleId + ' ' + options.clientId
            if (DEBUG) {
                console.group(label)
                console.time(label)
                var _callback = callback
                callback = function(error, instance) {
                    console.timeEnd(label)
                    console.groupEnd(label)
                    if (_callback) _callback(error, instance)
                }
            }

            __loadModule()

            function __loadModule(next) {
                next = next || __createInstance

                // 2. 加载组件模块
                // load module file
                /* jshint unused:false */
                // try {
                //     // 尝试快速获取已经加载过的模块
                //     BrixImpl = require(options.moduleId)
                //     setTimeout(next, 4)
                //     return
                // } catch (error) {}

                require([options.moduleId], function __loadModuleComplete(module) {
                    BrixImpl = module
                    next()
                }, function(error) {
                    // http://requirejs.org/docs/api.html#errbacks
                    if (callback) callback(new Error(error.message), instance)
                    else console.error(error.stack || error)

                    if (Loader.onerror) {
                        error.moduleId = options.moduleId
                        Loader.onerror(error) // 运行时异常收集
                    }
                })
            }

            function __createInstance(next) {
                next = next || __interceptInstanceDestroy

                try {
                    // 在组件模块上附加标记 __x_created_with，指示负责初始化的是 Brix Loader
                    // Add a mark to component module, indicating the Brix Loader is response for the initializing.
                    var __x_created_with = BrixImpl.__x_created_with
                    BrixImpl.__x_created_with = 'Brix Loader'

                    // 3. 创建组件实例（按需传入参数 options）
                    // Create a new module instance
                    instance = BrixImpl.length ? new BrixImpl(options) : new BrixImpl()

                    // 恢复标记
                    // Recovery the mark
                    BrixImpl.__x_created_with = __x_created_with

                    // 设置实例属性 options
                    instance.options = Util.extend(true, {}, instance.options, options)

                    // 设置其他公共属性
                    Util.extend(instance, Util.pick(options, Constant.OPTIONS))
                    instance.element.setAttribute('data-clientId', options.clientId)

                    next()
                } catch (error) {
                    if (callback) callback(error, instance)
                    else console.error(error.stack || error)

                    if (Loader.onerror) {
                        error.moduleId = options.moduleId
                        Loader.onerror(error) // 运行时异常收集
                    }
                }
            }

            function __interceptInstanceDestroy(next) {
                next = next || __cacheInstance

                // 拦截销毁方法
                // intercept destroy method of the module instance
                instance._destroy = instance.destroy
                instance.destroy = function() {
                    destroy(false, instance)
                }
                next()
            }

            function __cacheInstance(next) {
                next = next || __callInstanceInitialization

                // 缓存起来，关联父组件
                // cache the module instance
                cache(instance)
                next()
            }

            function __callInstanceInitialization(next) {
                next = next || __interceptInstanceRender

                // 4. 执行初始化
                // exec module instance initialize
                if (!instance.init) {
                    next()
                    return
                }

                try {
                    if (DEBUG) console.time(label + ' call  init')
                    var result = instance.init()
                    if (DEBUG) console.timeEnd(label + ' call  init')

                    // 如果返回了 Promise，则依赖 Promise 的状态
                    if (result && result.then) {
                        result.then(function() {
                            next()
                        }, function(error) {
                            throw error
                        })
                    } else {
                        next()
                    }
                } catch (error) {
                    if (callback) callback(error, instance)
                    else console.error(error)

                    if (Loader.onerror) {
                        error.moduleId = options.moduleId
                        Loader.onerror(error) // 运行时异常收集
                    }
                }
            }

            function __interceptInstanceRender(next) {
                next = next || __callInstanceRender

                // 拦截渲染方法
                // intercept render method of the module instance
                if (instance._render) {
                    next()
                    return
                }

                instance._render = instance.render
                instance.render = function() {
                    var deferred = Util.defer()
                    var promise = deferred.promise

                    // 如果存在已经被渲染的子组件，则先销毁
                    var hasRenderedChildren
                    if (instance.childClientIds.length) {
                        hasRenderedChildren = true
                        Util.each(instance.childClientIds, function(childClientId) {
                            if (CACHE[childClientId]) destroy(childClientId)
                        })
                    }
                    // 调用组件的 .render()
                    var result
                    if (instance._render) result = instance._render.apply(instance, arguments)
                    else console.warn(instance.clientId, instance.moduleId, 'render() is not defined')

                    // 如果返回了 Promise，则依赖 Promise 的状态
                    if (result && result.then) {
                        result.then(function() {
                            renderChildren()
                            syncClientId()
                        }, function(error) {
                            throw error
                        })
                    } else {
                        renderChildren()
                        syncClientId()
                    }

                    return promise

                    // 再次初始化子组件
                    function renderChildren() {
                        if (hasRenderedChildren) {
                            boot(instance.element, function( /* context */ ) {
                                deferred.resolve()
                            })
                        } else {
                            deferred.resolve()
                        }
                    }

                    // 同步 clientId
                    function syncClientId() {
                        var relatedElement = instance.relatedElement || instance.$relatedElement
                        if (relatedElement) {
                            // element
                            if (relatedElement.nodeType && (relatedElement.clientId === undefined)) {
                                relatedElement.clientId = options.clientId
                            } else if (relatedElement.length) {
                                // [ element ]
                                Util.each(relatedElement, function(item /*, index*/ ) {
                                    if (item.nodeType && (item.clientId === undefined)) {
                                        item.clientId = options.clientId
                                        item.setAttribute('data-moduleId', options.moduleId)
                                        item.setAttribute('data-clientId', options.clientId)
                                    }
                                })
                            }
                        }
                    }

                }
                next()
            }

            function __callInstanceRender(next) {
                next = next || __bindLifecycleEvent

                // 5. 执行渲染（不存在怎么办？必须有！）
                // exec render method of the module instance
                try {
                    if (DEBUG) console.time(label + ' call  render')
                    var result = instance.render(function(error /*, instance*/ ) {
                        if (error) {}
                    })
                    if (DEBUG) console.timeEnd(label + ' call  render')

                    // deferred
                    if (result && result.then) {
                        result.then(function() {
                            next()
                        }, function(error) {
                            if (callback) callback(error, instance)
                            else console.error(error.stack || error)

                            if (Loader.onerror) {
                                error.moduleId = options.moduleId
                                Loader.onerror(error) // 运行时异常收集
                            }
                        })
                    } else {
                        next()
                    }
                } catch (error) {
                    // TODO 渲染时发生错误的组件是否应该自动销毁？
                    if (callback) callback(error, instance)
                    else console.error(error.stack || error)

                    if (Loader.onerror) {
                        error.moduleId = options.moduleId
                        Loader.onerror(error) // 运行时异常收集
                    }
                }
            }

            function __bindLifecycleEvent(next) {
                next = next || __inspectDescendants

                // 绑定测试事件
                // bind lifecycle event of the module instance
                if (DEBUG && instance.on) {
                    Util.each(Constant.EVENTS, function(type) {
                        instance.on(type + Constant.LOADER_NAMESPACE, function(event) {
                            console.log(label, 'event', event.type)
                        })
                    })
                }
                next()
                    // .delay(100) // 每个组件之间的渲染间隔 100ms，方便观察
            }

            function __inspectDescendants(next) {
                next = next || __triggerReadyEvent

                // 检测是否有后代组件
                var descendants = element.getElementsByTagName('*')
                var hasBrixElement = false
                Util.each(descendants, function(descendant /*, index*/ ) {
                    if (descendant.nodeType !== 1) return
                    if (!hasBrixElement &&
                        descendant.getAttribute(Constant.ATTRS.id)) {
                        hasBrixElement = true
                    }
                })

                // 7. 如果有后代组件，则递归加载
                // boot descendants recursively
                if (hasBrixElement) {
                    boot(instance, function() {
                        next()
                    })
                } else {
                    // 如果没有后代组件，那么此时当前组件已经就绪。
                    next()
                }
            }

            function __triggerReadyEvent( /*next*/ ) {
                // 8. 当前组件和后代组件的渲染都完成后，触发 ready 事件
                // trigger ready event after current module instance and it's descendants are rendered
                if (instance.triggerHandler) {
                    instance.triggerHandler(Constant.EVENTS.ready)
                }
                if (callback) callback(undefined, instance)
            }
        }
41743
function bind(from, node, comPrefix, valPrefix, clsPrefix, ignores) {
  ignores = Object.assign({
    true: true,
    false: true,
    null: true,
    undefined: true
  }, ignores);

  let hasPath = false;

  //处理节点属性
  let attributes = node.attributes;
  for (let i in attributes) {
    if (!/^\d+$/.test(i)) continue;
    let attr = attributes[i];

    //处理属性值
    if (attr.value.indexOf('{') > -1) {
      attr.value = replaceString(from, attr.value, valPrefix, ignores);
    }

    //绑定事件
    if (/^(bind|catch)\w+/.test(attr.name)) {
      node.setAttribute('data-' + attr.name, attr.value);
      attr.value = '_dispatch';
      if (!hasPath && comPrefix) {
        node.setAttribute('data-path', comPrefix);
      }
    }

    //如果是循环标签,则在子标签中忽略循环索引和值变量
    if (attr.name === 'wx:for') {
      let index = node.getAttribute('wx:for-index') || 'index';
      let item = node.getAttribute('wx:for-item') || 'item';
      ignores[index] = true;
      ignores[item] = true;
    }

    if (clsPrefix && attr.name === 'class') {
      const matchArr = [];
      // "xxx {{a ? 'b' : 'c'}}"
      // => "xxx $"
      attr.value = attr.value.replace(/\{\{([^}]+)\}\}/ig, function (match) {
        matchArr.push(match);
        matchArr.push(match);
        return '$';
      });

      // => "xxx prefix-xxx $ prefix-$"
      attr.value = attr.value.split(' ').map(cls => `${cls} ${clsPrefix}-${cls}`).join(' ');

      // => "xxx prefix-xxx {{a ? 'b' : 'c'}} prefix-{{a ? 'b' : 'c'}}"
      attr.value = attr.value.replace(/\$/g, function () {
        const matchItem = matchArr.shift();
        return matchItem;
      });
    }
  }

  //如果节点为文本
  if (node.nodeName === '#text') {
    let data = node.data;
    if (data) {
      node.replaceData(0, data.length, replaceString(from, data, valPrefix, ignores));
    }
  }

  //递归处理子节点
  for (let i in node.childNodes) {
    if (!/^\d+$/.test(i)) continue;
    let n = node.childNodes[i];
    // 不转换template 定义
    if (n.nodeName === 'template' && n.getAttribute('name')) {
      bindTemplateEvents(n);
      continue;
    }
    bind(from, n, comPrefix, valPrefix, clsPrefix, ignores);
  }
}
1243347
protected function preprocessSelect()
    {
        // handle fields
        if (!isset($this->query['fields']) && !isset($this->query['distinct'])) {
            if (isset($this->query['count'])) {
                $this->query['fields'] = 'count(*)';
            } else {
                $this->query['fields'] = '*';
            }
        }
        
        if (isset($this->query['count']) || (is_string($this->query['fields'][0]) && strpos('count(', $this->query['fields'][0]) !== false)) {
            return ;
        }
        
        /**
         * 检查分页
         * start 作为初始偏移量
         * 
         * -- 解析出 pagesize
         * 1 如果设置了 limit, 从中解析出 offset|pagesize, offset 可能没有值
         * 2 如果未设置 limit 则检查 pagesize 或 num 选项, 得出 pagesize
         * 
         * -- 解析出 offset, 并得出最终 limit
         * 1 如果设置了 limit 且已包含offset, 则优先使用
         * 2 否则检查 page, 解析出 offset, 结合 pagesize 生成最终 limit
         * 3 否则使用已 解析的 start pagesize, 生成最终 limit
         */
        $start = isset($this->query['start']) && intval($this->query['start'][0])>0 ? intval($this->query['start'][0]) : 0;
        if (isset($this->query['limit'])) {     // 优先使用 limit
            if (is_numeric($this->query['limit'][0])) {
                $pagesize = $this->query['limit'][0];
            } else {
                if (!is_array($this->query['limit'][0])) $limitArr = explode(',', $this->query['limit'][0]);
                if (is_numeric($limitArr[0]) && is_numeric($limitArr[1])) {
                    $offset = $limitArr[0];
                    $pagesize = $limitArr[1];
                }
            }
        }
        if (!isset($pagesize) || ! $pagesize) {                  // limit 不存在则依次判断 pagesize, num
            if (isset($this->query['pagesize']) && intval($this->query['pagesize'][0])>0 ) {
                $pagesize   = intval($this->query['pagesize'][0]);
            } elseif (isset($this->query['num']) && intval($this->query['num'][0])>0 ) {
                $pagesize   = intval($this->query['num'][0]);
            }
        }
        
        if (isset($offset)) {
            $offset += $start;
            $limit      =  $offset . ',' . $pagesize;
        } elseif (isset($this->query['page'])) {
            $page       = intval($this->query['page'][0]) > 0 ? intval($this->query['page'][0]) : 1;
            // notice: $pagesize may be still null. 此时 pagesize 仍然可能为空，因为未设置或解析不正确
            $pagesize   = !empty($pagesize) ? $pagesize : 10;
            $offset     =  $start + $pagesize * ($page - 1);
            $limit      =  $offset . ',' . $pagesize;
        } elseif (isset($pagesize)) {
            $limit = $start . ',' . $pagesize;
        }
        if (isset($limit)) {
            $this->query->remove('limit')->set('limit', $limit);     // 强制重设
        }
    }
710653
@Override
	public Object call(Object[] args, Context context) {
		// 只能有一个参数且只能为字符串
		if ((args.length >= 1) && (args[0] instanceof String) && (args[0] != null)) {
			String spel = (String) args[0];
			Expression expression = getExpression(spel);
			// 如果有第二参数，取他作为根对象
			if ((args.length >= 2) && (args[1] != null)) {
				return expression.getValue(createEvaluationContext(args[1], context));
			} else {
				return expression.getValue(createEvaluationContext(Collections.emptyMap(), context));
			}
		}
		return null;
	}
248493
function props(data, list, val) {

    // 处理子对象
    if (list.length) {
        let name = list.shift();

        // 处理属性
        if (name) {
            name = unescape(name);

            if (!data) {
                data = num.test(name) ? [] : {};
            }

            data[name] = props(data[name], list, val);
        } else {
            data = [...(data || []), props(null, list, val)];
        }

        // 返回子对象
        return data;
    }

    // 返回值
    return val;
}
656516
private void select(String[] resultList, int resultIndex, List<String[]> result) {
		int resultLen = resultList.length;
		if (resultIndex >= resultLen) { // 全部选择完时，输出排列结果
			result.add(Arrays.copyOf(resultList, resultList.length));
			return;
		}

		// 递归选择下一个
		for (int i = 0; i < datas.length; i++) {
			// 判断待选项是否存在于排列结果中
			boolean exists = false;
			for (int j = 0; j < resultIndex; j++) {
				if (datas[i].equals(resultList[j])) {
					exists = true;
					break;
				}
			}
			if (false == exists) { // 排列结果不存在该项，才可选择
				resultList[resultIndex] = datas[i];
				select(resultList, resultIndex + 1, result);
			}
		}
	}
328607
@SuppressWarnings("unchecked")
	
	/**
	 * 返回列表 key 中，下标为 index 的元素。
	 * 下标(index)参数 start 和 stop 都以 0 为底，也就是说，以 0 表示列表的第一个元素，
	 * 以 1 表示列表的第二个元素，以此类推。
	 * 你也可以使用负数下标，以 -1 表示列表的最后一个元素， -2 表示列表的倒数第二个元素，以此类推。
	 * 如果 key 不是列表类型，返回一个错误。
	 */
	public <T> T lindex(Object key, long index) {
		Jedis jedis = getJedis();
		try {
			return (T)valueFromBytes(jedis.lindex(keyToBytes(key), index));
		}
		finally {close(jedis);}
	}
293127
static public function init() {

        // 日志目录转换为绝对路径 默认情况下存储到公共模块下面
        C('LOG_PATH',   realpath(LOG_PATH).'/Common/');

        // 定义当前请求的系统常量
        define('NOW_TIME',      $_SERVER['REQUEST_TIME']);
        define('REQUEST_METHOD',$_SERVER['REQUEST_METHOD']);
        define('IS_GET',        REQUEST_METHOD =='GET' ? true : false);
        define('IS_POST',       REQUEST_METHOD =='POST' ? true : false);
        define('IS_PUT',        REQUEST_METHOD =='PUT' ? true : false);
        define('IS_DELETE',     REQUEST_METHOD =='DELETE' ? true : false);

        // URL调度
        Dispatcher::dispatch();

        if(C('REQUEST_VARS_FILTER')){
			// 全局安全过滤
			array_walk_recursive($_GET,		'think_filter');
			array_walk_recursive($_POST,	'think_filter');
			array_walk_recursive($_REQUEST,	'think_filter');
		}

        define('IS_AJAX',       ((isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') || !empty($_POST[C('VAR_AJAX_SUBMIT')]) || !empty($_GET[C('VAR_AJAX_SUBMIT')])) ? true : false);

        // TMPL_EXCEPTION_FILE 改为绝对地址
        C('TMPL_EXCEPTION_FILE',realpath(C('TMPL_EXCEPTION_FILE')));
        return ;
    }
573816
public function getConnection() {
		if ($this->connection->count() === 0) {
			//是否需要建立新的连接
			if ($this->getMaxClient() > $this->connection_count) {
				$this->last_run_out_time = time();
				return $this->connect();
			}
			//wait
			$uid = co::getUid();
			$this->wait->push($uid);
			co::suspend();
			return $this->connection->pop();
		}
		if ($this->connection->count() === 1) {
			$this->last_run_out_time = time();
		}
		return $this->connection->pop();
	}
765316
private void onConnectEnd(final int rstCode) {
        HMSAgentLog.d("connect end:" + rstCode);

        synchronized (CALLBACK_LOCK) {
            // 回调各个回调接口连接结束
            for (IClientConnectCallback callback : connCallbacks) {
                aSysnCallback(rstCode, callback);
            }
            connCallbacks.clear();

            // 恢复默认不显示
            allowResolveConnectError = false;
        }

        synchronized (STATIC_CALLBACK_LOCK) {
            // 回调各个回调接口连接结束
            for (IClientConnectCallback callback : staticCallbacks) {
                aSysnCallback(rstCode, callback);
            }
            staticCallbacks.clear();
        }
    }
1179341
private static void processBiGram() {
        //移除二元模型出现频率为1的情况
        Iterator<String> iter = BIGRAM.keySet().iterator();
        while(iter.hasNext()){
            String key = iter.next();
            if(BIGRAM.get(key) < 2){
                iter.remove();
            }
        }
        try(BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream("src/main/resources/bigram.txt"),"utf-8"))){
            for(Entry<String, Integer> item : BIGRAM.entrySet()){
                writer.write(item.getKey()+" "+item.getValue()+"\n");
            }
        }catch(Exception e){
            LOGGER.info("保存bigram模型失败：", e);
        }
    }
1282840
function (rowIndex) {
            var row = this.table.rows[rowIndex],
                infoRow = this.indexTable[rowIndex],
                colsNum = this.colsNum,
                count = 0;     //处理计数
            for (var colIndex = 0; colIndex < colsNum;) {
                var cellInfo = infoRow[colIndex],
                    cell = this.getCell(cellInfo.rowIndex, cellInfo.cellIndex);
                if (cell.rowSpan > 1) {
                    if (cellInfo.rowIndex == rowIndex) {
                        var clone = cell.cloneNode(true);
                        clone.rowSpan = cell.rowSpan - 1;
                        clone.innerHTML = "";
                        cell.rowSpan = 1;
                        var nextRowIndex = rowIndex + 1,
                            nextRow = this.table.rows[nextRowIndex],
                            insertCellIndex,
                            preMerged = this.getPreviewMergedCellsNum(nextRowIndex, colIndex) - count;
                        if (preMerged < colIndex) {
                            insertCellIndex = colIndex - preMerged - 1;
                            //nextRow.insertCell(insertCellIndex);
                            domUtils.insertAfter(nextRow.cells[insertCellIndex], clone);
                        } else {
                            if (nextRow.cells.length) nextRow.insertBefore(clone, nextRow.cells[0])
                        }
                        count += 1;
                        //cell.parentNode.removeChild(cell);
                    }
                }
                colIndex += cell.colSpan || 1;
            }
            var deleteTds = [], cacheMap = {};
            for (colIndex = 0; colIndex < colsNum; colIndex++) {
                var tmpRowIndex = infoRow[colIndex].rowIndex,
                    tmpCellIndex = infoRow[colIndex].cellIndex,
                    key = tmpRowIndex + "_" + tmpCellIndex;
                if (cacheMap[key])continue;
                cacheMap[key] = 1;
                cell = this.getCell(tmpRowIndex, tmpCellIndex);
                deleteTds.push(cell);
            }
            var mergeTds = [];
            utils.each(deleteTds, function (td) {
                if (td.rowSpan == 1) {
                    td.parentNode.removeChild(td);
                } else {
                    mergeTds.push(td);
                }
            });
            utils.each(mergeTds, function (td) {
                td.rowSpan--;
            });
            row.parentNode.removeChild(row);
            //浏览器方法本身存在bug,采用自定义方法删除
            //this.table.deleteRow(rowIndex);
            this.update();
        }
988634
public void rmLittlePathByScore() {
        int maxTo = -1;
        Term temp = null;
        for (int i = 0; i < terms.length; i++) {
            if (terms[i] == null) {
                continue;
            }
            Term maxTerm = null;
            double maxScore = 0;
            Term term = terms[i];
            // 找到自身分数对大最长的

            do {
                if (maxTerm == null || maxScore > term.score()) {
                    maxTerm = term;
                } else if (maxScore == term.score() && maxTerm.getName().length() < term.getName().length()) {
                    maxTerm = term;
                }

            } while ((term = term.next()) != null);
            term = maxTerm;
            do {
                maxTo = term.toValue();
                maxScore = term.score();
                if (maxTo - i == 1 || i + 1 == terms.length)
                    continue;
                boolean flag = true;// 可以删除
                out: for (int j = i; j < maxTo; j++) {
                    temp = terms[j];
                    if (temp == null) {
                        continue;
                    }
                    do {
                        if (temp.toValue() > maxTo || temp.score() < maxScore) {
                            flag = false;
                            break out;
                        }
                    } while ((temp = temp.next()) != null);
                }
                // 验证通过可以删除了
                if (flag) {
                    for (int j = i + 1; j < maxTo; j++) {
                        terms[j] = null;
                    }
                }
            } while ((term = term.next()) != null);
        }
    }
355845
function travels(subsetMap) {
                            var newSubsetMap = {};
                            Object.keys(subsetMap).forEach(function (i) {
                                var index = +i;
                                parsedGlyfMap[index] = true;
                                // 当前的和下一个一样，或者最后一个无轮廓
                                if (loca[index] === loca[index + 1]) {
                                    glyphs[index] = {
                                        contours: []
                                    };
                                }
                                else {
                                    glyphs[index] = parse(reader, ttf, startOffset + loca[index]);
                                }

                                if (glyphs[index].compound) {
                                    glyphs[index].glyfs.forEach(function (g) {
                                        if (!parsedGlyfMap[g.glyphIndex]) {
                                            newSubsetMap[g.glyphIndex] = true;
                                        }
                                    });
                                }
                            });

                            if (!lang.isEmptyObject(newSubsetMap)) {
                                travels(newSubsetMap);
                            }
                        }
35791
@Override
	protected int pruneCache() {
		int count = 0;
		CacheObj<K, V> comin = null;

		// 清理过期对象并找出访问最少的对象
		Iterator<CacheObj<K, V>> values = cacheMap.values().iterator();
		CacheObj<K, V> co;
		while (values.hasNext()) {
			co = values.next();
			if (co.isExpired() == true) {
				values.remove();
				onRemove(co.key, co.obj);
				count++;
				continue;
			}

			//找出访问最少的对象
			if (comin == null || co.accessCount < comin.accessCount) {
				comin = co;
			}
		}

		// 减少所有对象访问量，并清除减少后为0的访问对象
		if (isFull() && comin != null) {
			long minAccessCount = comin.accessCount;

			values = cacheMap.values().iterator();
			CacheObj<K, V> co1;
			while (values.hasNext()) {
				co1 = values.next();
				co1.accessCount -= minAccessCount;
				if (co1.accessCount <= 0) {
					values.remove();
					onRemove(co1.key, co1.obj);
					count++;
				}
			}
		}
		
		return count;
	}