// Copyright (c) Umbraco.
// See LICENSE for more details.
namespace Umbraco.Extensions;
public static class IntExtensions
{
///
/// Does something 'x' amount of times
///
///
///
public static void Times(this int n, Action action)
{
for (var i = 0; i < n; i++)
{
action(i);
}
}
///
/// Creates a Guid based on an integer value
///
/// value to convert
///
///
///
public static Guid ToGuid(this int value)
{
Span bytes = stackalloc byte[16];
BitConverter.GetBytes(value).CopyTo(bytes);
return new Guid(bytes);
}
}