Skip to content

Commit

Permalink
[release] release 1.5.1-alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
VampireAchao committed Apr 17, 2023
1 parent d0e94bc commit 6678a04
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<revision>1.5.0-alpha</revision>
<revision>1.5.1-alpha</revision>
<mybatis-plus.version>3.5.3.1</mybatis-plus.version>
<byte-buddy.version>1.12.21</byte-buddy.version>
<lombok.version>1.18.24</lombok.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ private Maps() {
* @return a {@link java.util.Map} object
*/
public static <K, V> Map<K, V> of() {
return new HashMap<>();
return new HashMap<>(1 << 4);
}

/**
Expand All @@ -66,7 +66,7 @@ public static <K, V> Map<K, V> ofSize(int initialCapacity) {
* @param <V> a V class
* @return a {@link java.util.Map} object
*/
public static <K, V> Map<K, V> ofSize(K k, V v) {
public static <K, V> Map<K, V> of(K k, V v) {
final Map<K, V> map = ofSize(1);
map.put(k, v);
return map;
Expand All @@ -83,7 +83,7 @@ public static <K, V> Map<K, V> ofSize(K k, V v) {
* @param <V> a V class
* @return a {@link java.util.Map} object
*/
public static <K, V> Map<K, V> ofSize(K k, V v, K k1, V v1) {
public static <K, V> Map<K, V> of(K k, V v, K k1, V v1) {
final Map<K, V> map = ofSize(1 << 1);
map.put(k, v);
map.put(k1, v1);
Expand All @@ -103,7 +103,7 @@ public static <K, V> Map<K, V> ofSize(K k, V v, K k1, V v1) {
* @param <V> a V class
* @return a {@link java.util.Map} object
*/
public static <K, V> Map<K, V> ofSize(K k, V v, K k1, V v1, K k2, V v2) {
public static <K, V> Map<K, V> of(K k, V v, K k1, V v1, K k2, V v2) {
final Map<K, V> map = ofSize(1 << 2);
map.put(k, v);
map.put(k1, v1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ class MapsTest {

@Test
void testOf() {
Assertions.assertEquals("value", Maps.ofSize("key", "value").get("key"));
Assertions.assertEquals("value1", Maps.ofSize("key", "value", "key1", "value1").get("key1"));
Assertions.assertEquals("value", Maps.of("key", "value").get("key"));
Assertions.assertEquals("value1", Maps.of("key", "value", "key1", "value1").get("key1"));
Assertions.assertEquals(
"value2", Maps.ofSize("key", "value", "key1", "value1", "key2", "value2").get("key2"));
"value2", Maps.of("key", "value", "key1", "value1", "key2", "value2").get("key2"));
}

@Test
Expand Down

0 comments on commit 6678a04

Please sign in to comment.