Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

switched code to use nicer iteration over Map

  • Loading branch information...
commit 5802a6f0ba65ad8ade0bc65b808c0e521b41a4dd 1 parent 57a5e81
@jstrachan jstrachan authored
View
6 libraries/sandbox/templatelib/src/TemplateHtml.kt
@@ -44,10 +44,8 @@ abstract class Tag(val name : String) : Element() {
builder.append("<")
builder.append(name)
if (!attributes.isEmpty()) {
- for (e in attributes.entrySet()) {
- if (e != null) {
- builder.append(" ${e.getKey()}=\"${e.getValue()}\"")
- }
+ for (e in attributes) {
+ builder.append(" ${e.key}=\"${e.value}\"")
}
}
if (children.isEmpty()) {
View
19 libraries/tools/kdoc/src/main/kotlin/org/jetbrains/kotlin/doc/KDocConfig.kt
@@ -70,20 +70,15 @@ class KDocConfig() {
* Resolves a link to the given class name
*/
fun resolveLink(packageName: String): String {
- // TODO should be able to do something like
- // for (e in packageUrls.filterNotNull()) {
- val entrySet = packagePrefixToUrls.entrySet()
- if (entrySet != null) {
- for (e in entrySet) {
- val p = e?.getKey()
- val url = e?.getValue()
- if (p != null && url != null) {
- if (packageName.startsWith(p)) {
- return url
- }
+ for (e in packagePrefixToUrls) {
+ val p = e.key
+ val url = e.value
+ if (p != null && url != null) {
+ if (packageName.startsWith(p)) {
+ return url
}
}
- }
+ }
if (missingPackageUrls.add(packageName)) {
println("Warning: could not find external link to package: $packageName")
}
View
4 libraries/tools/kdoc/src/main/kotlin/org/jetbrains/kotlin/doc/templates/PackageFrameTemplate.kt
@@ -96,8 +96,8 @@ ${stylesheets()}
<TD NOWRAP><FONT size="+1" CLASS="FrameHeadingFont">Extensions</FONT>&nbsp;
<FONT CLASS="FrameItemFont">
<BR>""")
- for (e in map.entrySet()) {
- val c = e?.getKey()
+ for (e in map) {
+ val c = e.key
if (c != null) {
println("""<A HREF="${extensionsHref(pkg, c)}" title="extensions functions on class ${c.name} from ${pkg.name}" target="classFrame"><I>${c.name}</I></A>
<BR>""")
View
12 libraries/tools/kdoc/src/main/kotlin/org/jetbrains/kotlin/doc/templates/PackageSummaryTemplate.kt
@@ -136,9 +136,9 @@ ${pkg.detailedDescription(this)}
""")
val groupMap = pkg.groupClassMap()
- for (e in groupMap.entrySet()) {
- val group = e?.getKey() ?: "Other"
- val list = e?.getValue()
+ for (e in groupMap) {
+ val group = e.key ?: "Other"
+ val list = e.value
if (list != null) {
println(""" <h3>$group</h3>
@@ -275,13 +275,13 @@ Copyright &#169; 2010-2012. All Rights Reserved.
<B>Extensions Summary</B></FONT></TH>
</TR>""")
- for (e in map.entrySet()) {
- val c = e?.getKey()
+ for (e in map) {
+ val c = e.key
if (c != null) {
println("""<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="${extensionsHref(pkg, c)}" title="extensions on ${pkg.name}">${c.name}</A></B></TD>
<TD>""")
- val list = e?.getValue()
+ val list = e.value
if (list != null) {
val functions = filterDuplicateNames(list)
for (f in functions) {
Please sign in to comment.
Something went wrong with that request. Please try again.