mirror of
				https://github.com/SimpleMobileTools/Simple-Contacts.git
				synced 2025-06-05 21:59:27 +02:00 
			
		
		
		
	Use StringBuilder in String.times()
Has better performance than StringBuffer
This commit is contained in:
		@@ -1,9 +1,9 @@
 | 
			
		||||
package com.simplemobiletools.contacts.overloads
 | 
			
		||||
 | 
			
		||||
operator fun String.times(x: Int): String {
 | 
			
		||||
    val stringBuffer = StringBuffer()
 | 
			
		||||
    val sb = StringBuilder()
 | 
			
		||||
    for (i in 1..x) {
 | 
			
		||||
        stringBuffer.append(this)
 | 
			
		||||
        sb.append(this)
 | 
			
		||||
    }
 | 
			
		||||
    return stringBuffer.toString()
 | 
			
		||||
    return sb.toString()
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user