Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Clean up comments
  • Loading branch information
saber-wang committed Jun 9, 2025
commit e6e5201821ecd80b2783ae20d3849227d1fc181a
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public DMURLParser(String url) {
protected URLLocation fetchDatabaseHostsIndexRange() {
int hostLabelStartIndex = url.indexOf("//");
if (hostLabelStartIndex == -1) {
return new URLLocation(0, 0); // 格式错误
return new URLLocation(0, 0);
}
int hostLabelEndIndex = url.indexOf("?", hostLabelStartIndex + 2);
if (hostLabelEndIndex == -1) {
Expand Down Expand Up @@ -71,7 +71,6 @@ public ConnectionInfo parse() {
}
}

// 如果 host 或 port 没有从路径中获取到,则尝试从参数中获取
if (host.isEmpty()) {
host = fetchFromUrlParams(URL_PARAMS_HOST_KEY);
}
Expand All @@ -94,9 +93,6 @@ public ConnectionInfo parse() {
);
}

/**
* 从 URL 参数中提取指定 key 的值
*/
private String fetchFromUrlParams(String key) {
int paramIndex = url.indexOf("?");
if (paramIndex == -1) {
Expand Down
Loading