Skip to content

Commit

Permalink
#12681 tryRetain it is
Browse files Browse the repository at this point in the history
Signed-off-by: Ludovic Orban <[email protected]>
  • Loading branch information
lorban committed Jan 15, 2025
1 parent 65de5a6 commit e2aa7aa
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ public void writeTo(Content.Sink sink, long offset, long length, Callback callba
boolean retained = false;
try
{
retained = cachedRetain();
retained = tryRetain();
if (retained)
sink.write(true, BufferUtil.slice(_buffer.getByteBuffer(), Math.toIntExact(offset), Math.toIntExact(length)), Callback.from(this::release, callback));
else
Expand All @@ -389,7 +389,7 @@ public void writeTo(Content.Sink sink, long offset, long length, Callback callba
* its internal buffer if it is.
* @return true if this content can be used and has been retained, false otherwise.
*/
private boolean cachedRetain()
private boolean tryRetain()
{
return _cache.computeIfPresent(_cacheKey, (s, cachingHttpContent) ->
{
Expand Down

0 comments on commit e2aa7aa

Please sign in to comment.