Skip to content

Commit

Permalink
update: 移除一处无用代码 & 其他内部接口优化
Browse files Browse the repository at this point in the history
  • Loading branch information
wyouflf committed Oct 19, 2019
1 parent a9fdbab commit aa2d8f1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
5 changes: 3 additions & 2 deletions xutils/src/main/java/org/xutils/http/RequestParams.java
Original file line number Diff line number Diff line change
Expand Up @@ -399,8 +399,9 @@ private HttpRequest getHttpRequest() {
@Override
public String toString() {
String url = this.getUri();
String baseParamsStr = super.toString();
return TextUtils.isEmpty(url) ?
super.toString() :
url + (url.contains("?") ? "&" : "?") + super.toString();
baseParamsStr :
url + (url.contains("?") ? "&" : "?") + baseParamsStr;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,11 @@ public String buildCacheKey(RequestParams params, String[] cacheKeys) {
for (String key : cacheKeys) {
List<KeyValue> kvList = params.getParams(key);
if (kvList != null && !kvList.isEmpty()) {
String value = kvList.get(0).getValueStrOrNull();
if (value != null) {
result.append(key).append("=").append(value).append("&");
for (KeyValue kv : kvList) {
String value = kv.getValueStrOrNull();
if (value != null) {
result.append(key).append("=").append(value).append("&");
}
}
}
}
Expand Down
3 changes: 0 additions & 3 deletions xutils/src/main/java/org/xutils/http/request/HttpRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import java.net.URLEncoder;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
Expand Down Expand Up @@ -474,8 +473,6 @@ private static String toGMTString(Date date) {
"EEE, dd MMM y HH:mm:ss 'GMT'", Locale.US);
TimeZone gmtZone = TimeZone.getTimeZone("GMT");
sdf.setTimeZone(gmtZone);
GregorianCalendar gc = new GregorianCalendar(gmtZone);
gc.setTimeInMillis(date.getTime());
return sdf.format(date);
}
}

0 comments on commit aa2d8f1

Please sign in to comment.