more hacks to omit superfluous string object allocation

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@7757 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 14 years ago
parent 87082f407e
commit 535b6b953c

@ -414,7 +414,8 @@ public class IndexControlRWIs_p {
public static void genURLList(final serverObjects prop, final byte[] keyhash, final String keystring, final RankingProcess ranked, final Bitfield flags, final int maxlines) {
// search for a word hash and generate a list of url links
prop.put("genUrlList_keyHash", ASCII.String(keyhash));
String keyhashs = ASCII.String(keyhash);
prop.put("genUrlList_keyHash", keyhashs);
if (ranked.filteredCount() == 0) {
prop.put("genUrlList", 1);
@ -440,7 +441,7 @@ public class IndexControlRWIs_p {
prop.put("genUrlList_urlList_"+i+"_urlExists_urlhxCount", i);
prop.putHTML("genUrlList_urlList_"+i+"_urlExists_urlhxValue", entry.word().urlhash());
prop.putHTML("genUrlList_urlList_"+i+"_urlExists_keyString", keystring);
prop.put("genUrlList_urlList_"+i+"_urlExists_keyHash", ASCII.String(keyhash));
prop.put("genUrlList_urlList_"+i+"_urlExists_keyHash", keyhashs);
prop.putHTML("genUrlList_urlList_"+i+"_urlExists_urlString", us);
prop.put("genUrlList_urlList_"+i+"_urlExists_urlStringShort", (us.length() > 40) ? (us.substring(0, 20) + "<br>" + us.substring(20, 40) + "...") : ((us.length() > 30) ? (us.substring(0, 20) + "<br>" + us.substring(20)) : us));
prop.putNum("genUrlList_urlList_"+i+"_urlExists_ranking", (entry.ranking() - rn));

@ -590,7 +590,7 @@ public final class MetadataRepository implements Iterable<byte[]> {
URLHashCounter ds;
if (i != null) while (i.hasNext()) {
urlhashb = i.next();
hosthash = ASCII.String(urlhashb).substring(6);
hosthash = ASCII.String(urlhashb, 6, 6);
ds = map.get(hosthash);
if (ds == null) {
ds = new URLHashCounter(urlhashb);
@ -653,7 +653,7 @@ public final class MetadataRepository implements Iterable<byte[]> {
ScoreMap<String> hosthashScore = new ConcurrentScoreMap<String>();
for (Map.Entry<String, URLHashCounter> e: domainSamples.entrySet()) {
hosthashScore.inc(ASCII.String(e.getValue().urlhashb).substring(6), e.getValue().count);
hosthashScore.inc(ASCII.String(e.getValue().urlhashb, 6, 6), e.getValue().count);
}
URIMetadataRow.Components comps;
DigestURI url;

Loading…
Cancel
Save