Skip to content

Commit

Permalink
Updated TL
Browse files Browse the repository at this point in the history
  • Loading branch information
danielbodart committed Mar 28, 2016
1 parent 96810c3 commit b5e48f1
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion build/optional.dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ mvn:javax.servlet:javax.servlet-api:jar|sources:3.1.0

mvn:org.ccil.cowan.tagsoup:tagsoup:jar:1.2

mvn://repo.bodar.com/com.googlecode.lazyrecords:lazyrecords:pack|sources:2.24
mvn://repo.bodar.com/com.googlecode.lazyrecords:lazyrecords:pack|sources:2.30
2 changes: 1 addition & 1 deletion build/runtime.dependencies
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
mvn://repo.bodar.com/com.googlecode.totallylazy:totallylazy:pack|sources:2.221
mvn://repo.bodar.com/com.googlecode.totallylazy:totallylazy:pack|sources:2.238
mvn://repo.bodar.com/com.googlecode.yadic:yadic:pack|sources:2.45
10 changes: 7 additions & 3 deletions src/com/googlecode/utterlyidle/Parameters.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import com.googlecode.totallylazy.functions.Function1;
import com.googlecode.totallylazy.functions.Function2;
import com.googlecode.totallylazy.functions.Unary;
import com.googlecode.totallylazy.predicates.LogicalPredicate;
import com.googlecode.totallylazy.predicates.Predicate;
import com.googlecode.totallylazy.time.Dates;

Expand Down Expand Up @@ -44,7 +45,7 @@ public Self joinTo(Self self) {
}

public Self remove(String name) {
return self(values.deleteAll(filterByKey(name)));
return self(values.toSequence().reject(keyPredicate(name)).toPersistentList());
}

public Self replace(String name, String value) {
Expand Down Expand Up @@ -76,8 +77,11 @@ public Iterator<Pair<String, String>> iterator() {
}

protected Sequence<Pair<String, String>> filterByKey(String key) {
Predicate<First<String>> predicate = by(Callables.<String>first(), call(this.predicate, key));
return filter(predicate).realise();
return filter(keyPredicate(key)).realise();
}

private LogicalPredicate<First<String>> keyPredicate(String key) {
return by(Callables.<String>first(), call(this.predicate, key));
}

public Sequence<Pair<String, String>> filter(final Predicate<First<String>> predicate) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public Option<Cookie> get(String name){
}

public List<Cookie> toList() {
return values.map(CookieParameters::toCookie);
return values.toSequence().map(CookieParameters::toCookie).toPersistentList();
}

public static Cookie toCookie(Pair<String, String> pair) {
Expand Down

0 comments on commit b5e48f1

Please sign in to comment.