在将一些 python 代码移植到 PHP 中时,我遇到了以下代码的问题:
def getOrAdd(self, config):
h = config.hashCodeForConfigSet()
l = self.configLookup.get(h, None)
if l is not None:
r = next((c for c in l if config.equalsForConfigSet(c)), None)
if r is not None:
return r
if l is None:
l = [config]
self.configLookup[h] = l
else:
l.append(config)
return config
我想不通,线是什么
r = next((c for c in l if config.equalsForConfigSet(c)), None)
确实意味着。
谁能解释一下这句话的含义?
先感谢您!