提交 e49b5636 编写于 作者: 智布道's avatar 智布道 👁

📝 change: Optimize code

上级 cd039799
......@@ -215,7 +215,7 @@ public class RequestUtil {
public static Map<String, JapHttpCookie> getCookieMap(JapHttpRequest request) {
final JapHttpCookie[] cookies = request.getCookies();
if (null == cookies || cookies.length == 0) {
return new HashMap<>();
return new HashMap<>(0);
}
return Arrays.stream(cookies).collect(Collectors.toMap(JapHttpCookie::getName, v -> v, (k1, k2) -> k1));
......
......@@ -50,7 +50,7 @@ public class OidcUtil {
String issuer = EndpointUtil.getIssuer(request);
Map<String, Object> model = new HashMap<>();
Map<String, Object> model = new HashMap<>(33);
model.put("issuer", issuer);
model.put("authorization_endpoint", EndpointUtil.getAuthorizeUrl(request));
model.put("token_endpoint", EndpointUtil.getTokenUrl(request));
......
......@@ -262,7 +262,7 @@ public class QrCodeUtil {
*/
public HashMap<EncodeHintType, Object> toHints() {
// 配置
final HashMap<EncodeHintType, Object> hints = new HashMap<>();
final HashMap<EncodeHintType, Object> hints = new HashMap<>(7);
if (null != this.charset) {
hints.put(EncodeHintType.CHARACTER_SET, charset.toString().toLowerCase());
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册