This is an automated email from the ASF dual-hosted git repository. btellier pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/james-project.git
commit d9606971b9bb9fa79c9faef7ed9aa78db429346c Author: Benoit Tellier <[email protected]> AuthorDate: Sat Jun 26 20:09:49 2021 +0700 [PERFORMANCE] Email/get serialization: initialize DateTimeFormatter once --- .../src/main/scala/org/apache/james/jmap/json/package.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/json/package.scala b/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/json/package.scala index 2fe419f..9219314 100644 --- a/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/json/package.scala +++ b/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/json/package.scala @@ -93,8 +93,8 @@ package object json { mailAddress => JsSuccess(mailAddress)) case _ => JsError("mail address needs to be represented with a JsString") } - private[json] implicit val utcDateWrites: Writes[UTCDate] = - utcDate => JsString(utcDate.asUTC.format(DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ssX"))) + private val dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ssX") + private[json] implicit val utcDateWrites: Writes[UTCDate] = utcDate => JsString(utcDate.asUTC.format(dateTimeFormatter)) private[json] implicit val hasMoreChangesWrites: Writes[HasMoreChanges] = Json.valueWrites[HasMoreChanges] private[json] implicit val limitReads: Reads[Limit] = { case JsNumber(underlying) if underlying > 0 => JsSuccess(Limit.of(underlying.intValue)) --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
